2
votes

I have a VB6 ActiveX control project (creating an .OCX), which has several User Controls. The controls are being loaded by an EXE (also VB6). When I run the EXE directly, it runs OK, but when I try to run it in the debugger (I need to step through the code), it cant't load the user controls (.ctl), gives me "Class not registered. Looking for object with CLSID:..." message

I have the Binary Compatibility set (kept all the old GUIDs), and I see the classes in the registry, everything looks OK - just doesn't run in debugger.

Any help please?

1
Are both Projects being opened as a Project Group?Bob77
no, the project is for the OCX, and the EXE is in Debuging->Start ProgramOleg Ivanov
Ok, then it sounds like compatibility has been broken. Does the error dialog show the full CLSID? If so, does it match what you see in the registry? And are you running the VB6 IDE elevated?Bob77
the error dialog does show the full CLSID;Oleg Ivanov
You said "it cant't load the user controls (.ctl)". Have you added the .ctl files directly to the second project or are you referencing the compiled .ocx file?Deanna

1 Answers

2
votes

I've been working with VB6 for over a decade now. The problem is that the VBP project reference is out of sync with the latest build of your OCX user control. Simply open the project as a group or the EXE project on it's own and click Project->Components.

You will now see one of two things. Either the reference will be invalid or you have a valid reference chosen. Either way, uncheck the reference and click okay (do not re-select it during this operation.. trust me). Now, close that dialog and go back into Projects->Components, now pick your OCX control from the list. This will solve your problem. If your OCX is not in the list than rebuild it independently first and try again.

This is an undocumented bug with the VB6 IDE. Even with VB6 SP6 it had not been solved.