0X80040112

CLASS_E_NOTLICENSED (0X80040112) Fix: COM Class Licensing

Windows Errors Intermediate 👁 1 views 📅 May 28, 2026

This COM licensing error means a class object isn't licensed. The fix: re-register the DLL with regsvr32 or fix DCOM permissions.

You're staring at CLASS_E_NOTLICENSED (0X80040112) and it's a pain because nothing obvious tells you what's broken. The error literally means the COM class you're trying to instantiate doesn't have a valid machine-wide license. This usually hits when a program calls a COM object (like an OLE control, an ActiveX component, or a shell extension) that requires a license key stored in the registry — and that key is missing, corrupted, or the permissions are wrong.

The Real Fix: Re-register the Component

What's actually happening here is that the COM class's license key lives under HKEY_CLASSES_ROOT\Licenses in the registry. When a DLL or OCX gets installed, its setup writes a binary license blob there. If that key gets deleted, or if the DLL itself is unregistered, you get 0x80040112. The fix is straightforward: re-register the offending DLL.

  1. Open Command Prompt as Administrator. Don't skip this — without admin rights, regsvr32 will fail silently for system-level COM objects.
  2. Identify which DLL triggered the error. If you have an error log or a crash dialog that mentions a specific module (like somecontrol.ocx or comdlg32.ocx), use that. If not, check the application's installation folder or search for .ocx and .dll files that look related.
  3. Run: regsvr32 /i "C:\Path\To\Your\Component.dll". The /i flag tells the DLL to reinstall its license keys. Some components need this flag; others work with plain regsvr32.
  4. Restart the application that was failing.

If you don't know the exact DLL, run regsvr32 /i comctl32.ocx and regsvr32 /i comdlg32.ocx — these are common culprits in older Windows apps using Common Controls.

When regsvr32 Returns An Error

Sometimes regsvr32 gives you a different error (like DllRegisterServer failed). The reason step 3 works only if the DLL is present and not corrupted. You'll need to reinstall the application or the runtime library (like Visual Basic 6 runtime, or the Microsoft Visual C++ redistributable) to restore the missing files.

Why This Fix Works

COM licensing works through a two-step handshake. When you call CoCreateInstance for a licensed class, COM checks the registry under HKEY_CLASSES_ROOT\CLSID\{the-class-guid}\Licensing. If that value exists, COM passes it to the DLL's IClassFactory2::GetLicInfo or CreateInstanceLic method. The DLL then validates the license blob. If the blob is missing or invalid, the DLL returns CLASS_E_NOTLICENSED. Running regsvr32 /i calls DllInstall, which writes the license blob back into the registry. That's why it fixes the error — it rebuilds the key that COM checks.

Less Common Variations of the Same Issue

You might see 0x80040112 in different contexts that need different tweaks.

DCOM Permission Problems

If the application runs as a different user (like a service or a scheduled task), the user account might not have permission to access the COM class's license key. Open dcomcnfg (Component Services), find the specific application under Component Services > Computers > My Computer > DCOM Config, right-click it, go to Properties > Security, and give the relevant user Launch and Activation permissions. This doesn't happen often, but when it does, re-registering won't help — the license key is fine, the permissions are blocking it.

Corrupted User Profile

In rare cases, the license key is stored in HKEY_CURRENT_USER\Software\Classes\Licenses instead of HKEY_CLASSES_ROOT. If the user profile is corrupted, that hive gets out of sync. Create a new local user account and test the application there. If it works, migrate the profile or rebuild it.

Antivirus Blocking COM Registration

Some aggressive antivirus software hooks COM registration calls and blocks them, especially during software installation. If the error started after an antivirus update, try temporarily disabling real-time protection, then reinstall the application.

Prevention

The easiest way to avoid this error is to never run registry cleaners. They often strip out license keys they mistake for orphaned entries. I've seen CCleaner and similar tools delete the Licenses key under HKEY_CLASSES_ROOT, causing exactly this error days or weeks later. If you must clean the registry, export the HKEY_CLASSES_ROOT\Licenses key first.

Also, when uninstalling old software, use the official uninstaller, not a brute-force delete of the program folder. COM DLLs often leave their registry entries behind when the folder is simply deleted, but the license key can get corrupted if the uninstaller doesn't run its cleanup properly.

Keep your Visual C++ redistributable packages up to date. Many licensed COM components depend on specific runtime DLLs. A mismatch between the runtime version and the component's expectation can trigger licensing failures. I've seen this on Windows 10 22H2 with an old VB6 app that expected an older MSVBVM60.dll — reinstalling the VC++ 6 redist fixed it.

One last thing: if you're dealing with a custom-built COM component from your own code, check that you're calling CoInitialize and CoInitializeSecurity with the right parameters. A missing or misconfigured security call can prevent license negotiation, even if the registry is fine.

Was this solution helpful?