Link to home
Start Free TrialLog in
Avatar of huangs3
huangs3Flag for Canada

asked on

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"

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!
Avatar of CSecurity
CSecurity
Flag of Iran, Islamic Republic of image

Type regsvr32 COMCTL32.OCX

in run or in cmd

Then run your program. COMCTL32.OCX should be in windows or system32 or in PATH
Avatar of huangs3

ASKER

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...
 
ASKER CERTIFIED SOLUTION
Avatar of CSecurity
CSecurity
Flag of Iran, Islamic Republic of image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Robberbaron (robr)
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.
Avatar of huangs3

ASKER

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.