| Previous | Next |
| REGDB_E_INVALIDVALUE | REGDB_E_IIDNOTREG |
REGDB_E_CLASSNOTREG
Class not registered
When Windows returns REGDB_E_CLASSNOTREG—HRESULT 2147746132, 0x80040154, signed -2147221164—AllStat describes the condition as “Class not registered”. The actionable meaning is The requested CLSID has no usable COM class registration in the caller’s context. The surrounding operation is CoCreateInstance, CoGetClassObject, moniker binding, or another class activation request.
The high bit in 0x80040154 is set, so this is a failure rather than a success or informational result. Its facility field is 4 (FACILITY_ITF) and its low 16-bit code is 340 (0x0154). Those bit fields classify the value, but they do not identify the failing object by themselves; the native method, object identity, and first producer of this result remain essential.
Precise failure point
Understanding this result requires this subsystem context: COM registration is architecture-, scope-, and identity-sensitive. A key visible in Registry Editor is not proof that the failing process sees the same view or that the values form a coherent activation contract.
- Associate this result with one exact operation in CLSID/IID registry lookup, InprocServer32 or LocalServer32 metadata, interface proxy registration, package policy, and threading-model interpretation.
- Confirm that this result came from CoCreateInstance, CoGetClassObject, moniker binding, or another class activation request, rather than from cleanup or a wrapper that ran afterward.
- Preserve any IErrorInfo, underlying Win32 result, provider message, or callback failure that preceded it; the HRESULT alone should not erase a more specific cause.
Diagnostic evidence
A useful incident records the CLSID or IID, registry view, process architecture, user or machine hive, server path, ThreadingModel text, package identity, access result, and deployment version. Also retain the application and component build, architecture, process and thread IDs, COM apartment, operation correlation ID, elapsed time, and the first state-changing event before the failure. When logging it, redact content and credentials while preserving types, lengths, hashes, opaque identities, and lifecycle generations needed to reproduce its contract.
- log CLSID, class context, architecture, package identity, and user SID.
- inspect the effective registration rather than searching for similarly named DLLs.
- confirm that the registered server exists, matches the machine architecture, and exports or registers the class.
Resolution path
- Capture it at the first native return before a wrapper maps it to a generic exception.
- Identify the exact object, method, and lifecycle phase involved in CoCreateInstance, CoGetClassObject, moniker binding, or another class activation request.
- Reproduce it with one controlled input or state change, and verify that the correction changes the decisive evidence rather than merely hiding the result.
Distinct causes
- It can result when the component is not installed or registration was removed.
- It can result when 32-bit and 64-bit processes see different class registrations.
- It can result when the CLSID is correct for another product version, package, user, or deployment scope.
Retry policy
Correction. for it, install or repair the owning component, or use the CLSID documented for the deployed version. Retry boundary. Retry only after registration or deployment changes; copying a DLL without its installer is not a valid fix. Before repeating the operation, complete or roll back the installer transaction, re-read the exact user or machine registry view, and discard class factories obtained from superseded registration.
Practical scenario
A desktop tool is rebuilt as x64 while its legacy in-process plugin remains x86; selecting an out-of-process bridge or installing an x64 plugin resolves activation. This isolates it within COM registration database lookup and activation metadata and provides a regression test for the stated correction.
Difference from related HRESULTs
CLASS_E_CLASSNOTAVAILABLE means a class factory was found but could not supply the class; it means activation could not locate usable class registration. Keep those outcomes separate in exception mappings, telemetry dimensions, user messages, and automated retry policy.
Developer and administrator guidance
Treat registration as deployment data, record architecture and scope on every lookup, validate ThreadingModel text, and avoid runtime self-repair that guesses missing keys. Regression coverage for it should include 32-bit and 64-bit views, per-user and per-machine registration, missing and malformed values, packaged and unpackaged activation, access denial, and upgrade rollback.
Operational repair for it must target the evidence-backed owner: use the product’s supported installer or package deployment path and inspect the same registry view as the failing process; do not create CLSID or IID entries from a different machine. Retain before-and-after traces for it so the change can be attributed and reversed.
References
- Microsoft: generic COM error codes
- Microsoft: HRESULT values
- Microsoft: registering COM components
- Microsoft: InprocServer32
- Microsoft: COM registry keys
Looking for a different code? Search another status or error code.
