Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

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

Posted on 2004-04-28
6
Medium Priority
?
3,320 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 6

Accepted Solution

by:
mmusante earned 750 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

How to Use the Help Bell

Need to boost the visibility of your question for solutions? Use the Experts Exchange Help Bell to confirm priority levels and contact subject-matter experts for question attention.  Check out this how-to article for more information.

Question has a verified solution.

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

The debugging module of the VB 6 IDE can be accessed by way of the Debug menu item. That menu item can normally be found in the IDE's main menu line as shown in this picture.   There is also a companion Debug Toolbar that looks like the followin…
Have you ever wanted to restrict the users input in a textbox to numbers, and while doing that make sure that they can't 'cheat' by pasting in non-numeric text? Of course you can do that with code you write yourself but it's tedious and error-prone …
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…
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…
Suggested Courses

886 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