Solved

Runtime Error '372' when trying to run program with custom ActiveX Control

Posted on 2004-04-28
6
3,253 Views
Last Modified: 2013-12-25
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.
0
Comment
Question by:vandil
6 Comments
 
LVL 6

Expert Comment

by:mmusante
Comment Utility
Try to set your OCX Compatibility to 'Binary Compatibility' and then re-compile your applications your applications
0
 
LVL 7

Expert Comment

by:OHDev2004
Comment Utility
just a clue ;
are you putting the OCX in the same folder of your app ,or did you try to copy it to the Win\System32 ,,
mmusante's comment maybe a solution :)
0
 

Author Comment

by:vandil
Comment Utility
I've tried setting the OCX to Binary Compatibility and recompiling. When I opened the project on the dev systems, they gave me a message that 1.0 doesn't exist, so they're updating to 2.0. I then took this OCX, the only one on the system, and installed it onto my test system. I still get the runtime 372.

I have tried placing the OCX in the folder with the application, placing it in the system directory and registering it, and placing it in the system directory without registering it, just for kicks. The only time that I didn't get the runtime 372 was when it was in the system directory unregistered, at which point I got the could not file OCX error message, as expected.
0
Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

 
LVL 6

Accepted Solution

by:
mmusante earned 250 total points
Comment Utility
May be that your OCX use a component that isn't registered in your test system ... have you made an installation package for your program?
0
 

Author Comment

by:vandil
Comment Utility
It turns out that we had added all of the dependencies for the file, but that the installation script was updated after the install was compiled, so we were missing one of the files in it. If we had compiled 20 minutes later than we had, we wouldn't have had the problem at all.

Thanks for your suggestions, everyone.
0
 

Expert Comment

by:freeberm
Comment Utility
I am (was) experiencing the same problem.  I have a custom control compiled with vb6 (SP6).  The application that uses the control was also written with vb6 (sp6).  Some installations work fine, others do not (on XP, 2000, etc.)  From searching on the net a little, it discovered that this error could also be caused by an incorrect version of a dependent .dll or .ocx.  My installation package currently installs:
Asycfilt.dll
Comcat.dll
Msvbvm60.dll
Oleaut32.dll
Olepro32.dll
Stdole2.tlb

COMDLG32.OCX
MSCOMCTL.OCX
riched32.dll
RICHTX32.OCX
msxml.dll
msvcrt.dll
scrrun.dll

I added:
MSCOMCT2.OCX

and now the installation works fine.

Hope it is the file you were missing as well.
0

Featured Post

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

This article describes some techniques which will make your VBA or Visual Basic Classic code easier to understand and maintain, whether by you, your replacement, or another Experts-Exchange expert.
Since upgrading to Office 2013 or higher installing the Smart Indenter addin will fail. This article will explain how to install it so it will work regardless of the Office version installed.
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now