Solved

How to resolve the error message "ERROR 339 - COMPONENT 'COMCTL32.OCX' OR ONE OF ITS DEPEDENCIES NOT CORRECTLY REGISTERED: A FILE IS MISSING OR INVALID"

Posted on 2009-07-10
5
1,631 Views
Last Modified: 2013-11-26
Hi Experts:

    I have a program written in VB6 working fine on many computers, but returned the following error messages on some computers:
**********************************************************************************
ERROR 339 - COMPONENT 'comctl32.ocx' OR ONE OF ITS DEPENDENCIES NOT CORRECTLY REGISTERED: A FILE IS MISSING OR INVALID
**********************************************************************************

Here are my observations up to now:
1. The executable and some accompanied OCX/DLL files (including COMCTL32.OCX) are placed in a network drive.
2. I searched around and found COMDLG32.OCX and MFC42.DLL may be related, but then I found that a computer with the issue also have these two files.
3. The copy of COMCTL32.OCX on netword path be being used, because if I remove it the program will not work on a computer that it originally works.
4. A non-working computer does not have a copy of COMCTL32.OCX

Can I have some idea how to fix the error? Where to check and what to try?

Thank you!
0
Comment
Question by:huangs3
  • 2
  • 2
5 Comments
 
LVL 17

Expert Comment

by:CSecurity
Comment Utility
Type regsvr32 COMCTL32.OCX

in run or in cmd

Then run your program. COMCTL32.OCX should be in windows or system32 or in PATH
0
 

Author Comment

by:huangs3
Comment Utility
Hi C Security:

     Do you mean COMCTL32.OCX must be registered?
     The COMCTL32.OCX I put on network drive together with the program is definitely not registered (because it is on a network drive), but if I remove it, the program wouldn't work. Does this indicate that COMCTL32.OCX does not need registeration?
      I want to avoid registering ocx files in computers because not too many users have administers privilege, and manually register ocx files may also not be approved...
 
0
 
LVL 17

Accepted Solution

by:
CSecurity earned 500 total points
Comment Utility
That's not possible.

In each PC you want to run your program which needs comctl32.ocx, you have to copy comctl32.ocx to Windows or System32 or in PATH or near to your exe, then in RUN (Start Menu -> Run) or in Cmd.exe

You have to type:
regsvr32 comctl32.ocx
then press enter.

Then you can run your program, otherwise it's not possible. All ActiveXes should be regsvr32'ed in order to used by programs
0
 
LVL 32

Expert Comment

by:Robberbaron (robr)
Comment Utility
It is possible to run with the OCX on the network drive, provided it is in the same location as the exe file. (the application folder)

BUT...
If someone or some other application has installed and registered the comctl32.ocx to the local machine (which is probably the correct thing to do!), then that installed version will be the one used, regardless of what is in the application folder.

if you create a package for your application and get all users to run that, it will install the ocx for you (and all others needed). The trick is to change the install package so that it references (not install) your exe on the network drive. That way you can post updated exe file without needing all users to reinstall. (At least until you update a required control).  

All this can be done using the VB Application and Package Wizard, as ive used it for 2 current projects and havent required a new package for quite a while.  If a new pc is rolled out, run the package once on it.
0
 

Author Comment

by:huangs3
Comment Utility
Hi robertbaron:

    I found it is not possible, because I encountered a computer without comctl32.ocx, but the program still not running, so I think it is as what C Security said: it must be registered.

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

There is an easy way, in .NET, to centralize the treatment of all unexpected errors. First of all, instead of launching the application directly in a Form, you need first to write a Sub called Main, in a module. Then, set the Startup Object to th…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Viewers will learn how to properly install Eclipse with the necessary JDK, and will take a look at an introductory Java program. Download Eclipse installation zip file: Extract files from zip file: Download and install JDK 8: Open Eclipse and …
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

728 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

10 Experts available now in Live!

Get 1:1 Help Now