| Previous | Next |
| TYPE_E_TYPEMISMATCH | TYPE_E_IOERROR |
TYPE_E_OUTOFBOUNDS
Type-information argument count is outside the valid range
TYPE_E_OUTOFBOUNDS is HRESULT 2147650721 (0x80028CA1) from winerror.h. AllStat describes it as “Invalid number of arguments.” The result belongs to creation or inspection of function and property descriptions in a type library. The important boundary is not merely failure but which object and state transition established: the number or index of metadata arguments lies outside the limits of the current member description.
The decisive meaning of this result is that the number or index of metadata arguments lies outside the limits of the current member description. The severity bit does not decide handling; the controlling fact is that the number or index of metadata arguments lies outside the limits of the current member description. Interpret it at the native boundary before a wrapper hides the condition that the number or index of metadata arguments lies outside the limits of the current member description.
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 this HRESULT must distinguish caller, runtime, provider, and backing resource while testing whether the number or index of metadata arguments lies outside the limits of the current member description.
Typical causes and interpretation boundary
The immediate contract boundary is specific: the number or index of metadata arguments lies outside the limits of the current member description. Common cause branches include the following:
- A FUNCDESC count does not match the allocated parameter array.
- An importer reads a stale index after the member list changed.
- A generator emits more arguments than the target Automation representation supports.
Confirm the cause branch that explains why the number or index of metadata arguments lies outside the limits of the current member description by using call arguments, object state, metadata, device information, or provider traces.
Correct handling and recovery
The primary recovery is to recompute parameter counts and indices from the current metadata, then rebuild rather than patching the binary type library. The result failure report should expose enough creation or inspection of function and property descriptions in a type library state to understand why the number or index of metadata arguments lies outside the limits of the current member description without a production debugger.
Retry this result only when evidence shows the state behind “the number or index of metadata arguments lies outside the limits of the current member description” can change and the operation is repeatable. Reconcile persistent, remote, device, or ownership state before repeating it.
Practical scenario
An IDL generator removes an optional parameter but leaves cParams and the parameter table out of sync, causing final type-info layout to fail. Record the decisive state for this HRESULT and verify recovery on a fresh object or request generation.
Difference from related HRESULTs
DISP_E_BADPARAMCOUNT is raised during IDispatch invocation; it is a type-information construction or inspection failure Tests and telemetry should preserve that boundary for this HRESULT.
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 creation or inspection of function and property descriptions in a type library as a versioned unit instead of copying arbitrary DLLs. Repair for this HRESULT 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.