Stef82

Hi, I have developed an user control in .net and registered it with regasm for com control. I open visual c++ 6.0 and add my activex to the project, but when I try to add a variable to control activex with class wizard I receive this error:

"The ActiveX Control is not registered properly, or its type library version number is incorrect. Try registering the control by removing and importing it in the Component Gallery"

How can I solve



Re: Visual C++ General .net user control as activex in vc6

nobugz

A .NET assembly doesn't contain a type library. You'll have to create one with Tlbexp.exe, then load that one with the #import directive instead of the DLL.





Re: Visual C++ General .net user control as activex in vc6

Stef82

Thanks nobugz, but when I load TypeLibrary from code with #import directive, how can I display my control in the DialogBox

Thanks nobug for your assistance Smile





Re: Visual C++ General .net user control as activex in vc6

nobugz

Oops, didn't realize you wanted to use it in a dialog. Moved to C++ General.





Re: Visual C++ General .net user control as activex in vc6

Stef82

But Can I Do it





Re: Visual C++ General .net user control as activex in vc6

Bite Qiu - MSFT

Is it a .NET assembly or ActiveX Control To manually register a ActiveX Control, try use regsvr32.exe:

Code Block

regsvr32 <ocx file name>