| Previous | Next |
| TYPE_E_CANTCREATETMPFILE | TYPE_E_INCONSISTENTPROPFUNCS |
TYPE_E_CANTLOADLIBRARY
Type library or supporting DLL cannot be loaded
TYPE_E_CANTLOADLIBRARY is HRESULT 2147654730 (0x80029C4A) from winerror.h. AllStat describes it as “Error loading type library/DLL.” The result belongs to LoadTypeLib, registry-based type-library lookup, or import of referenced metadata. The important boundary is not merely failure but which object and state transition established: the requested type library or DLL cannot be mapped and interpreted as the expected metadata source.
The decisive meaning of this result is that the requested type library or DLL cannot be mapped and interpreted as the expected metadata source. The severity bit does not decide handling; the controlling fact is that the requested type library or DLL cannot be mapped and interpreted as the expected metadata source. Interpret it at the native boundary before a wrapper hides the condition that the requested type library or DLL cannot be mapped and interpreted as the expected metadata source.
Where the result appears
- This result can surface in a type-library compiler, importer, registration step, proxy generator, or Automation metadata consumer.
- map the failure to one concrete operation among LoadTypeLib, RegisterTypeLib, ITypeInfo, ICreateTypeInfo, FUNCDESC, TYPEDESC, and imported LIBID versions.
- Preserve LIBID, type-library version, LCID, SYSKIND, TYPEKIND, GUID, MEMBERID, HREFTYPE, and the producer toolchain before releasing or replacing the object that returned this result.
An incident record for it must distinguish caller, runtime, provider, and backing resource while testing whether the requested type library or DLL cannot be mapped and interpreted as the expected metadata source.
Typical causes and interpretation boundary
The immediate contract boundary is specific: the requested type library or DLL cannot be mapped and interpreted as the expected metadata source. Common cause branches include the following:
- The registered path points to a missing or wrong-architecture binary.
- A dependent imported type library is absent.
- The file is present but corrupt, blocked, or built for an incompatible format.
Confirm the cause branch that explains why the requested type library or DLL cannot be mapped and interpreted as the expected metadata source by using call arguments, object state, metadata, device information, or provider traces.
Correct handling and recovery
The primary recovery is to repair the matching package and registration, verify architecture and dependencies, then load the exact deployed version. The result failure report should expose enough LoadTypeLib, registry-based type-library lookup, or import of referenced metadata state to understand why the requested type library or DLL cannot be mapped and interpreted as the expected metadata source without a production debugger.
Retry this result only when evidence shows the state behind “the requested type library or DLL cannot be mapped and interpreted as the expected metadata source” can change and the operation is repeatable. Reconcile persistent, remote, device, or ownership state before repeating it.
Practical scenario
A 32-bit Automation client resolves the LIBID to a 64-bit-only DLL resource and receives the load failure even though the registry entry exists. Record the decisive state for it and verify recovery on a fresh object or request generation.
Difference from related HRESULTs
TYPE_E_LIBNOTREGISTERED means registration is absent; it also covers a registered path that cannot actually be loaded Tests and telemetry should preserve that boundary for it.
Developer and administrator guidance
Developers handling it should make object lifetime and state transitions explicit, preserve the native HRESULT, and keep cleanup paths safe when initialization or output is partial. Use a minimal IDL or metadata fixture that reproduces the exact graph, then validate both 32-bit and 64-bit generated artifacts.
Administrators should repair the component owning LoadTypeLib, registry-based type-library lookup, or import of referenced metadata as a versioned unit instead of copying arbitrary DLLs. Repair for it should target only the evidence-backed component, provider, document, device, or configuration.
References
- Microsoft: COM error codes for TYPE_E and OLE
- Microsoft: LoadTypeLib
- Microsoft: CreateTypeLib2
- Microsoft: ITypeInfo
Looking for a different code? Search another status or error code.
