Solved

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

Posted on 2004-04-28
6
3,259 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
ID: 10946688
Try to set your OCX Compatibility to 'Binary Compatibility' and then re-compile your applications your applications
0
 
LVL 7

Expert Comment

by:OHDev2004
ID: 10948453
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
ID: 10950808
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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 6

Accepted Solution

by:
mmusante earned 250 total points
ID: 10956625
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
ID: 10960927
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
ID: 10961038
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

If you have ever used Microsoft Word then you know that it has a good spell checker and it may have occurred to you that the ability to check spelling might be a nice piece of functionality to add to certain applications of yours. Well the code that…
Article by: Martin
Here are a few simple, working, games that you can use as-is or as the basis for your own games. Tic-Tac-Toe This is one of the simplest of all games.   The game allows for a choice of who goes first and keeps track of the number of wins for…
Get people started with the process of using Access VBA to control Excel using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Excel. Using automation, an Access application can laun…
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…

863 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

26 Experts available now in Live!

Get 1:1 Help Now