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). Windows reports “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.

API stage

A COM class factory separates discovery of a class object from creation of an instance. Keeping those stages distinct reveals whether the defect is registration, factory selection, aggregation, licensing, or server implementation.

  • Associate this result with one exact operation in CoGetClassObject, IClassFactory::CreateInstance, aggregation rules, class availability, and optional licensing.
  • Confirm that this result came from licensed class creation through IClassFactory or IClassFactory2, rather than from cleanup or a wrapper that ran afterward.

Verification steps

  1. Identify the exact object, method, and lifecycle phase involved in licensed class creation through IClassFactory or IClassFactory2.
  2. Capture the class CLSID, factory interface, license method, and whether a key was supplied.
  3. Separate machine licensing from runtime design-time keys.
  4. Verify product edition, deployment identity, clock-dependent policy, and server-provided error information.

Interpretation limits

  • It can result when the machine license is missing or not valid for the installed edition.
  • It can result when a runtime key was not requested, persisted, or supplied to CreateInstanceLic.
  • It can result when the caller uses CoCreateInstance or another helper that bypasses the required IClassFactory2 licensing flow.

Incident record

A useful incident records the CLSID, requested IID, class context, server path, pUnkOuter value, factory interface, activation machine, license path, and the first server-side return.

Recovery conditions

Correction. install or activate the legitimate license and use the class vendor’s documented IClassFactory2 flow; never synthesize or copy keys between deployments. Retry condition. Retry only after license state changes or a valid key is obtained; repeated creation attempts should be rate-limited and audited. Before repeating the 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.

Difference from related HRESULTs

REGDB_E_CLASSNOTREG is deployment registration failure; it occurs after the class is known but creation policy refuses it.

Developer and administrator guidance

Keep class-object discovery separate from CreateInstance, log pUnkOuter and the initial IID, and make licensed creation an explicit IClassFactory2 path. Regression coverage 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.

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.

References


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