Friday, February 3, 2012

How to Register a VB6 OCX


1. Open Visual Basic 6.0 from a desktop shortcut or your Start menu. Choose 'File,' then 'New Project.' Set the type as 'Standard EXE.'
2. Add a new module to the project. Name the module 'Module1' or any other basic title you prefer.
3. Copy the example code provided by Microsoft (see References) into the 'General Declarations' section of the module you created. Replace all instances of 'ComCtl32' in the code with the name of the Visual Basic 6.0 OCX file that you want to register.
4. Press 'Control' and 'G'at the same time to view the immediate window. Type in 'RegisterYourOCX' where 'YourOCX' is the name of the OCX file you are registering ('ComCtl32' in the example). Press 'Enter' to register the OCX file.