Site icon EfmSoft

What does HRESULT 0x80040112 (CLASS_E_NOTLICENSED) mean?

 
Previous Next
CLASS_E_CLASSNOTAVAILABLE VIEW_E_DRAW

CLASS_E_NOTLICENSED

Class is not licensed for use

CLASS_E_NOTLICENSED has hexadecimal value 0x80040112 (unsigned 2147746066, signed -2147221230). AllStat records “Class is not licensed for use”. The narrow interpretation is that the COM class requires a license that is absent or invalid for this creation path. The failing stage is licensed class creation through IClassFactory or IClassFactory2.

The high bit in 0x80040112 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 274 (0x0112). 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 CLASS_E_NOTLICENSED remain essential.

API stage

Understanding CLASS_E_NOTLICENSED requires this subsystem context: A COM class factory separates discovery of a class object from creation of an instance. For CLASS_E_NOTLICENSED, keeping those stages distinct reveals whether the defect is registration, factory selection, aggregation, licensing, or server implementation.

Verification steps

  1. Capture CLASS_E_NOTLICENSED at the first native return before a wrapper maps it to a generic exception.
  2. Identify the exact object, method, and lifecycle phase involved in licensed class creation through IClassFactory or IClassFactory2.
  3. Capture the class CLSID, factory interface, license method, and whether a key was supplied.
  4. Separate machine licensing from runtime design-time keys.
  5. Verify product edition, deployment identity, clock-dependent policy, and server-provided error information.
  6. Reproduce CLASS_E_NOTLICENSED with one controlled input or state change, and verify that the correction changes the decisive evidence rather than merely hiding the result.

Interpretation limits

Incident record

A useful CLASS_E_NOTLICENSED incident records the CLSID, requested IID, class context, server path, pUnkOuter value, factory interface, activation machine, license path, and the first server-side return. For CLASS_E_NOTLICENSED, 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 CLASS_E_NOTLICENSED, redact content and credentials while preserving types, lengths, hashes, opaque identities, and lifecycle generations needed to reproduce its contract.

Recovery conditions

Correction. For CLASS_E_NOTLICENSED, install or activate the legitimate license and use the class vendor’s documented IClassFactory2 flow; never synthesize or copy keys between deployments. Retry boundary. Retry only after license state changes or a valid key is obtained; repeated creation attempts should be rate-limited and audited. Before repeating the CLASS_E_NOTLICENSED operation, release any factory or partially initialized instance, determine whether a server process was launched, and avoid reusing a factory obtained before deployment or license state changed.

Practical scenario

A host loads a licensed ActiveX component through CoCreateInstance, which cannot supply its saved runtime key; acquiring IClassFactory2 and calling CreateInstanceLic resolves the contract. This isolates CLASS_E_NOTLICENSED within COM class factories and object creation and provides a regression test for the stated correction.

Difference from related HRESULTs

REGDB_E_CLASSNOTREG is deployment registration failure; CLASS_E_NOTLICENSED occurs after the class is known but creation policy refuses it. For CLASS_E_NOTLICENSED, keep those outcomes separate in exception mappings, telemetry dimensions, user messages, and automated retry policy.

Developer and administrator guidance

For CLASS_E_NOTLICENSED, keep class-object discovery separate from CreateInstance, log pUnkOuter and the initial IID, and make licensed creation an explicit IClassFactory2 path. Regression coverage for CLASS_E_NOTLICENSED should include in-process and local-server contexts, null and non-null controlling unknowns, IID_IUnknown aggregation rules, stale factories after upgrade, and valid versus missing license state.

Operational repair for CLASS_E_NOTLICENSED must target the evidence-backed owner: verify the registered server path and product version with the supported installer, and use the vendor’s licensing mechanism rather than copying registration or license material between machines. Retain before-and-after traces for CLASS_E_NOTLICENSED so the change can be attributed and reversed.

References


Looking for a different code? Search another status or error code.

Exit mobile version