What does HRESULT 0x80028027 (TYPE_E_UNDEFINEDTYPE) mean?

 
Previous Next
TYPE_E_LIBNOTREGISTERED TYPE_E_QUALIFIEDNAMEDISALLOWED

TYPE_E_UNDEFINEDTYPE

Type information references an undefined type

TYPE_E_UNDEFINEDTYPE is HRESULT 2147647527 (0x80028027) from winerror.h. AllStat describes it as “Bound to unknown type.” The value must be interpreted at ITypeInfo binding, type-library compilation, or imported metadata resolution, because the same high-level symptom can come from a different contract boundary and require different cleanup.

The decisive Interpretation is that a referenced type cannot be resolved in the current library or its imported libraries. The operational record for this HRESULT needs the native value, symbolic constant, component build, and call phase; the message alone is insufficient.

Where the result appears

  • This result belongs to type-library and metadata processing around ITypeInfo binding, type-library compilation, or imported metadata resolution.
  • identify the LIBID, major/minor version, LCID, SYSKIND, file path, resource ID, and the specific ITypeLib or ITypeInfo operation.
  • Metadata consumers should treat this result as a contract-version or construction problem until file integrity, registry view, import dependencies, TYPEKIND, and builder phase are verified.

Separate caller state from runtime and server state first; otherwise cleanup and retry may target the wrong generation of the operation.

Typical causes and interpretation boundary

Common cause categories for this HRESULT are: an imported library is missing; a forward declaration is never defined; version skew removes the type; reference handles are corrupt. Each possible cause of this result predicts different outputs and recovery behavior, which should be verified explicitly.

The check that separates this result from nearby HRESULTs is: a referenced type cannot be resolved in the current library or its imported libraries. Without proof of the distinguishing condition for this HRESULT, the safest action is to preserve evidence and refrain from destructive cleanup.

Evidence and telemetry

  • Record it with the type-library path and hash, LIBID and version, LCID, architecture, source package, and producer toolchain.
  • capture referencing member; type name or HREFTYPE; imported LIBIDs; compile order; library versions; namespace aliases.
  • Retain the exact type, member, field, name, MEMBERID, HREFTYPE, TYPEKIND, or registry path involved in it.
  • When it is produced during generation, record construction order, imported libraries, layout/finalization state, and output TLB hash.
  • After it, release TYPEATTR, FUNCDESC, VARDESC, BSTR, and interface resources using the matching API even when parsing or lookup fails.

A useful it event contains ownership and shape information, not raw documents, passwords, access tokens, or full Automation values.

Diagnostic sequence

  • Capture it (0x80028027) before a compiler, importer, or language runtime reduces it to a generic metadata error.
  • Verify the exact type-library identity, file/resource loaded, registry view, architecture, and operation that returned it.
  • Prove the decisive metadata condition for this HRESULT: a referenced type cannot be resolved in the current library or its imported libraries.
  • Test the likely causes independently for this HRESULT: an imported library is missing; a forward declaration is never defined; version skew removes the type; reference handles are corrupt.
  • For <code>it</code>, enumerate the relevant TYPEATTR, members, imports, names, IDs, locales, and builder state instead of assuming source declarations match deployed metadata.
  • Rebuild or reload one corrected metadata generation and verify that it disappears without introducing a different identity or compatibility break.

Correct handling and recovery

The appropriate recovery is to load all declared dependencies, define forward types before final layout, and rebuild libraries in dependency order. Repeat the operation only after the failed condition has changed and the caller can distinguish a duplicate effect.

When it is returned, use the documented output contract and reconcile remote or persistent effects before replaying the request.

Practical scenario

A generated interface references a record from an imported library that was omitted from deployment; installing the dependency resolves binding.

An automated test for this HRESULT should verify raw HRESULT, output ownership, cleanup behavior, and the absence of an unsafe automatic retry.

Difference from related HRESULTs

TYPE_E_ELEMENTNOTFOUND is a generic lookup miss; it means a type reference cannot be completed.

The comparison matters operationally for this HRESULT: one result may permit fallback while the other requires repair, cancellation, or state reconciliation.

Developer and administrator guidance

Tools handling it should pin type-library identity and version, avoid caching raw indices across versions, and preserve stable GUIDs and DISPIDs for published contracts. Repair for <code>it</code> should be performed by the metadata producer or installer, not by ad hoc registry edits in the consuming process.

Administrators should compare installed files and registration against the product manifest, repair the matching package, and keep 32-bit and 64-bit registry views explicit. For <code>it</code>, copying a TLB from another machine can silence lookup while creating a more dangerous ABI mismatch.

References


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