Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2004-04-28
6
Medium Priority
?
3,299 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
VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

 
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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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…
I was working on a PowerPoint add-in the other day and a client asked me "can you implement a feature which processes a chart when it's pasted into a slide from another deck?". It got me wondering how to hook into built-in ribbon events in Office.
As developers, we are not limited to the functions provided by the VBA language. In addition, we can call the functions that are part of the Windows operating system. These functions are part of the Windows API (Application Programming Interface). U…
Get people started with the utilization of class modules. Class modules can be a powerful tool in Microsoft Access. They allow you to create self-contained objects that encapsulate functionality. They can easily hide the complexity of a process from…
Suggested Courses

715 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