Pregunta

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?

¿Fue útil?

Solución

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.

Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top