Solved

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

Posted on 2004-04-28
6
3,279 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
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

Salesforce Made Easy to Use

On-screen guidance at the moment of need enables you & your employees to focus on the core, you can now boost your adoption rates swiftly and simply with one easy tool.

Question has a verified solution.

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

When trying to find the cause of a problem in VBA or VB6 it's often valuable to know what procedures were executed prior to the error. You can use the Call Stack for that but it is often inadequate because it may show procedures you aren't intereste…
Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
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
Course of the Month5 days, 1 hour left to enroll

635 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