שתף באמצעות


Self-Registration for an OCX failed

Question

Sunday, January 27, 2008 11:57 PM

I have been trying to add an OCX control to the tool box in VB.net. When I select the OCX file through Choose Item/Com Components/Browse I can see the file but when I hit Ok I continually get a message "Self-Registration for <filename>.ocx failed"

Why does this occur and how do you overcome it. I can not find any reference to this problem anywhere but I would be very surprised if I was the first person to encounter it.

What is self-registration? Why would a file that works fine in VB 6 not work in .net?

Thanks

David

All replies (1)

Wednesday, January 30, 2008 5:17 AM ✅Answered

DavidTriggs,

 

Based on your post, you would like to add an OCX control in VB.NET IDE Toolbox and use in Windows Form application. I would like to provide you the suggestions as follows:

 

1. Self-registration is the standard means through which a server module can package its own registry operations, both registration and unregistration, into the module itself. When used with licensing handled through IClassFactory2, a server can become an entirely self-contained module with no need for external installation programs or .reg files.

 

2. Please make sure the unmanaged ocx component is registered correctly in your system registry. You can try to use RegSvr32.exe tool for the registration work. The following KB article shows you the common issues with this tool:

 

Explanation of Regsvr32 usage and error messages

 

Additional information:

 

User Interface Controls in Visual Basic 6 and Visual Basic 2005: Convert Visual Basic 6 UI controls into Visual Basic 2005 easily and efficiently.

 

Can't import Active X Control: I reproduced the problem and provided the solution for the question similar as yours.

 

Hope that can help you.