Run time Error, missing comdlg32.ocx file

Posted on 2008-10-28
Last Modified: 2012-05-05
One of our users is getting this error when running an application and getting to a certain point.

It comes up with 'Run-Time Error '339' Component 'comdlg32.ocx' not correctly registered: File is missing or invalid.'

Now I have followed the instructions on similar posts and have downloaded the comdlg32.ocx file and ran 'regsvr32 c:\windows\system32\comdlg32.ocx'.

This brings up a success message when run, however, the application still throws up the error!
I carried out the same procedure on another laptop with the same issue and it worked fine.

Any ideas on what else I could try out?
Question by:alfatech1
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
  • 3
  • 2
  • 2
LVL 35

Accepted Solution

torimar earned 250 total points
ID: 22823945
This .ocx control comes in different versions belonging to different versions of VB/VS.
Newer files are downward compatible, but if you happen to have downloaded an older version of the file than the one required by the application, it will not be accepted.

Right click the file and select 'Properties' > 'Version',  take note of date and version number, and google for it again. Then try to download a newer version; like maybe this one:

Repeat the registration process.

Btw: There is not only a "comdlg32.ocx", but also a "comdlg32.dll". Are you sure the error messages kept referring to the same file all the time?

Expert Comment

ID: 22825109
You can try to run depends.exe, it fixed a similar problem for me a month ago:


Assisted Solution

Fiuca earned 250 total points
ID: 22825182
Per Microsoft:

The Dependency Walker, Depends.exe, is used to determine the explicit dependencies a file has. A dependency is a secondary file, which is necessary for a file to load/run properly. For example, a Microsoft Visual Basic application is dependent upon the Microsoft Visual Basic run-time files.

Depends.exe also presents plenty of valuable information about dependent components, such as their export table, internal version number, and so forth.

Depends.exe ships with Microsoft Visual Basic and is located on the installation CD's at the following location:
Copy all the files from the Depend folder into the System (or System32) folder.

To use depends.exe, perform the following steps:
1.      From the Windows Start menu, choose Run.
2.      Type in the path and name to the Depends.exe file. You can also run the Depends.exe file by double-clicking the file through the Windows Explorer. Once Depends.exe executes at least once on your system, you may right-click any .exe, .dll, .ocx or other file and select View Dependencies from the shortcut menu to launch the Depends.exe file.
3.      When Depends.exe launches, select File and then choose Open.
4.      Browse in the Open dialog box for an .exe, .dll, or .ocx file and then click Open.
5.      The explicit dependencies for that particular component will appear.

For more information on the Depends.exe file, please refer to the Utilities On-line help.

SharePoint Admin?

Enable Your Employees To Focus On The Core With Intuitive Onscreen Guidance That is With You At The Moment of Need.


Author Comment

ID: 22825857
Thanks for the suggestions, I will give these a try and let you know how I get on.
LVL 35

Expert Comment

ID: 22828281
The dependency walker is indeed a nice programme, and I've always liked it a lot, but it displays the version numbers of the depending libraries as they are installed on your system, it does not show the exact version number of a library that the examined executable was compiled with.

The only way I know of that will give you the exact version number of a library that was used while developing an application is by looking at the setup.LST file produced by the Deployment Wizard. This can, of course, only be done on the system where the application was compiled, viz. by its programmer.

The Dependency Walker may be used to troubleshoot an .ocx/.dll that won't register (by exploring and profiling regsvr32.exe as explained here:, but in the present case the control registers ok, so no use either.

Author Comment

ID: 22830260
Tried downloading a newer version of comdlg32.ocx and registered this file but it still comes up with the same error message - 'comdlg32.ocx not correctly registered'.

Have downloaded and ran dependency walker. Ran depends.exe and opened the comdlg32.ocx file and it had reported 2 errors/warnings. The first was a missing msjava.dll file, which I have now downloaded and copied to the system32 folder. The other warning I am not sure about, so need a little help with this:

It is coming up with 'Warning: At least one module has an unresolved import due to a missing export function in a delay-load dependent module.' for file 'c:\windows\system32\MPR.DLL'.

How do I fix this one? Also, do I need to register the msjava.dll file or is it enough just to copy it to the system32 folder which I have already done?


Author Comment

ID: 22831165
Hi have sorted it now. I had another user log onto the laptop and the application worked fine for them.

Recreated the affected users' profile and it has fixed the run-time error.

Thanks for your inputs, I will spread the points out equally.

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

If you get continual lockouts after changing your Active Directory password, there are several possible reasons.  Two of the most common are using other devices to access your email and stored passwords in the credential manager of windows.
No single Antivirus application (despite claims by manufacturers) will catch or protect you from all Virus / Malware or Spyware threats. That doesn't stop you from further protecting yourself however - and this article is to show you how.
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…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …

733 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