Click here to Skip to main content
15,887,214 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have to use an ocx file with my C# Windows application. I am able to successfully refer and and access the methods defined in the ocx file. But:

  1. When I am trying to instantiate the object like
    objIRC = new IRCClass();

    then I compile time error is getting "The type 'IRC.IRCClass' has no constructors defined"
  2. So I tried with out new keyword. The object reference error is occuring 'Object reference not set to an instance of an object'. On googling I got some advice to use the Activator methods, which I found not good.

Do you have any idea why this is happening?
NB: I only have the ocx file. No idea about it.

Thanking you
Baji Jabbar :)
Posted
Updated 12-Nov-10 1:44am
v3

1 solution

This simply means that this class cannot be instantiated but is has private or protected constructors. Have a look at where you downloaded it maybe they give pointers on how to use it.

Good luck!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900