Windows PC Errors

How to Fix COMDLG32.ocx Missing or Invalid Error on Windows

COMDLG32.ocxPlain English: a helper file from the 1990s that old programs need is missing or broken. Your program cannot start because Windows cannot find this shared component.
Quick answer: Reinstall the program as an administrator first — that alone registers the control most of the time. If the error survives, copy comdlg32.ocx into C:\Windows\SysWOW64 (on 64-bit Windows), register it with regsvr32 comdlg32.ocx from an admin command prompt, and run the program as administrator.

What the COMDLG32.ocx error means

COMDLG32.ocx is an ActiveX control file — Microsoft's Common Dialog control — that shipped with programs written in Visual Basic 6, the development tool behind thousands of small utilities, accounting apps, training software, and classic games from the late 90s and 2000s. Whenever one of those programs needs a familiar Windows dialog, like the Open File window or a font picker, it calls this file instead of building its own.

Modern versions of Windows no longer include the file, so every old program is supposed to install and register it itself during setup. When that step goes wrong, the program crashes on launch with one of these messages: "Component COMDLG32.ocx or one of its dependencies is not correctly registered: a file is missing or invalid," or the shorter "COMDLG32.ocx missing." The wording sounds intimidating, but the fix is straightforward: get the file into the right folder and tell Windows about it.

You will run into this error most often when installing a legacy business application, an old CD-ROM game, or a niche utility downloaded from a forum or archive. It is never a virus warning and never means your Windows installation is broken — it simply means one old component is absent.

Common causes

How to fix the COMDLG32.ocx error — step by step

Work through these fixes in order. The first two resolve the vast majority of cases without any manual file juggling.

  1. Reinstall the program that shows the error. Before touching system files, fix the most common cause: a sloppy install. Uninstall the program from Settings, then right-click its installer and choose Run as administrator, and reinstall it completely. A proper admin install usually registers comdlg32.ocx by itself. Launch the program after the reinstall and check whether the error is gone before doing anything else.
  2. Place comdlg32.ocx in the correct system folder. If the reinstall did not help, get a copy of comdlg32.ocx. The safest sources are another Windows PC you own, the program's original installer files, or Microsoft's own Visual Basic 6 runtime files. On 64-bit Windows, copy comdlg32.ocx to C:\Windows\SysWOW64. On 32-bit Windows, copy it to C:\Windows\System32. Putting the 32-bit control in the wrong folder is the single most common reason manual fixes fail, so double-check which Windows edition you have in Settings, System, About.
  3. Register the control with regsvr32. The file alone is not enough; Windows must be told it exists. Press the Windows key, type cmd, right-click Command Prompt and choose Run as administrator. On 64-bit Windows, type cd C:\Windows\SysWOW64 and press Enter, then type regsvr32 comdlg32.ocx and press Enter. On 32-bit Windows, run the same command from C:\Windows\System32. A dialog saying DllRegisterServer succeeded confirms the registration worked.
  4. Run the program as an administrator. Many older programs that depend on comdlg32.ocx also need elevated rights to access their own files. Right-click the program's shortcut or executable and choose Run as administrator. If that clears the error, make it permanent: right-click the shortcut, choose Properties, open the Compatibility tab, tick Run this program as an administrator, and click OK.
  5. Run the program in compatibility mode. Programs built around this control were usually written for Windows XP or 7, and modern Windows sometimes blocks how they load ActiveX controls. Right-click the program shortcut, choose Properties, and open the Compatibility tab. Tick Run this program in compatibility mode for and pick Windows 7 or Windows XP (Service Pack 3) from the list. Click Apply, then launch the program normally.
  6. Repair Windows system files with SFC and DISM. If the control file keeps going missing or registrations fail, underlying system corruption may be the culprit. Open Command Prompt as administrator and run sfc /scannow, then restart your PC when it finishes. If problems persist, run DISM.exe /Online /Cleanup-image /Restorehealth from the same admin prompt, wait for it to complete, and run sfc /scannow once more.
  7. Install the Visual Basic 6 runtime files. As a last resort, install Microsoft's official Visual Basic 6.0 SP6 runtime files, which include the registered version of comdlg32.ocx and the other legacy components these programs expect. Search Microsoft's download site for the Visual Basic 6.0 SP6 runtime and install it with admin rights, then restart your PC and try the program again.

Did this fix it? Quick checklist

If the error persists after all seven steps, verify you are fighting the right battle: search the program's own folder for a bundled copy of the control — some installers ship it but name the folder something odd. You can also copy the file from another computer that runs the same program successfully, which guarantees you have a known-good version. As a final fallback, consider running the program inside a Windows 7 virtual machine, where the control and its registration behave exactly as the program's original developers expected.

Frequently asked questions

What is COMDLG32.ocx?

COMDLG32.ocx is an ActiveX control file from Microsoft's Common Dialog control, originally shipped with programs written in Visual Basic 6. It gives those programs their standard Windows dialogs, such as Open File, Save As, and the color and font pickers. Modern Windows no longer includes it, so older software must install and register it itself, and when that step fails you get the missing or invalid error.

Where do I put COMDLG32.ocx: System32 or SysWOW64?

On 64-bit Windows, comdlg32.ocx is a 32-bit control and belongs in C:\Windows\SysWOW64, which is the folder 64-bit Windows uses for 32-bit system files. On 32-bit Windows it belongs in C:\Windows\System32. Despite the confusing names, putting the file in SysWOW64 on a 64-bit system is correct, and placing it in System32 there is the most common reason regsvr32 registrations fail.

Is it safe to download COMDLG32.ocx from a DLL website?

It carries real risk. DLL download sites are a known vector for malware bundled into supposedly innocent system files, and a trojaned ActiveX control runs with whatever privileges your programs have. Prefer safe sources: the program's original installer, a copy from another Windows PC you own, or Microsoft's official Visual Basic 6 runtime files. If you must use a third-party copy, scan it with Windows Security and upload it to VirusTotal before placing it in a system folder.

Why does regsvr32 fail when I try to register comdlg32.ocx?

The three usual reasons are: you ran the command prompt without admin rights, you ran it from the wrong folder (System32 instead of SysWOW64 on 64-bit Windows), or the OCX file itself is corrupt or incompatible. Re-run from an elevated prompt in the correct folder, verify the file size is around 140 to 150 KB, and make sure you copied the 32-bit version of the control.