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
  • 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.

Will my email signature work in Office 365?

You've built an email signature using raw HTML code in Office 365, but you can't review how it looks with Transport Rules. So you have to test it over and over again before it can be used. Isn't this a bit of a waste of your time? Wouldn't a WYSIWYG editor make it a lot easier?


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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

If you have done a reformat of your hard drive and proceeded to do a successful Windows XP installation, you may notice that a choice between two operating systems when you start up the machine. Here is how to get rid of this: Click Start Clic…
Several part series to implement Internet Explorer 11 Enterprise Mode
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…
The viewer will learn how to successfully create a multiboot device using the SARDU utility on Windows 7. Start the SARDU utility: Change the image directory to wherever you store your ISOs, this will prevent you from having 2 copies of an ISO wit…

932 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