Run time Error, missing comdlg32.ocx file

Posted on 2008-10-28
Medium Priority
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
  • 3
  • 2
  • 2
LVL 35

Accepted Solution

torimar earned 1000 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 1000 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.

Independent Software Vendors: 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!


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: http://www.dependencywalker.com/faq.html), 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

Become an Android App Developer

Ready to kick start your career in 2018? Learn how to build an Android app in January’s Course of the Month and open the door to new opportunities.

Question has a verified solution.

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

Know the reasons and solutions to move/import EDB to New Exchange Server. Also, find out how to recover an Exchange .edb file and to restore the file back.
Dropbox has a relatively new feature called Smart Sync.  This feature allows Dropbox Professional (not plus) and Dropbox Business (if enabled) users to store information in Dropbox WITHOUT storing any files on their computer.
In this video, we discuss why the need for additional vertical screen space has become more important in recent years, namely, due to the transition in the marketplace of 4x3 computer screens to 16x9 and 16x10 screens (so-called widescreen format). …
Finding and deleting duplicate (picture) files can be a time consuming task. My wife and I, our three kids and their families all share one dilemma: Managing our pictures. Between desktops, laptops, phones, tablets, and cameras; over the last decade…
Suggested Courses

609 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