Runtime Error '372' when trying to run program with custom ActiveX Control
Posted on 2004-04-28
I am having a version compatibility issue with an ActiveX Control created in Visual Basic 6 SP5.
The component has two exposed User Control items (and three exposed classes, two not creatable, one multi-use) and is compiled into an OCX. The control is compiled on its own for use within two separate applications. This is the first implementation of the control, so the compatibility version is 1.0 with "No Compatibility" set for the compile, or 2.0 after making a couple tweaks and recompiling with Project Compatibility set. The only dependencies of the control are MSCOMCT2.OCX and MSMASK32.OCX.
The two main applications are also compiled in Visual Basic 6 SP5 as a Standard EXE project and reference the OCX as a component. The compile produces an executable without generating errors or warnings. On the development machines, the executable runs without issue.
When either or both applications are deployed to a non-development system running either Windows 98 SE or Windows 2000, the application will start fine, but once the user reaches a point where it would instantiate one of the user controls from the OCX, the application crashes with the following error message (the control and object names are generalized for this posting);
Runtime Error '372'
Failed to load control 'ControlName' from MyControl.OCX. Your version of MyControl.OCX may be outdated. Make sure you are using the version of the control that was provided with your application.
I have checked numerous times that the correct OCX file and its dependencies are being deployed and registered, trying both with an automated Wise install, and manually registering with RegSvr32. It has also been checked that the class identity GUID is the correct one. I could share the source for the control into both projects and just not use an OCX, but it would be cleaner and a better model to keep it separate as it is now.
If anyone can provide the definitive information to solve this, or a direct solution, it would be most appreciated. If I have left out any important information, simply prompt for it and I will post it.