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!
huangs3Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

CSecurityCommented:
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
huangs3Author Commented:
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
CSecurityCommented:
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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Robberbaron (robr)Commented:
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
huangs3Author Commented:
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
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.