| Previous | Next |
| DISP_E_UNKNOWNNAME | DISP_E_BADVARTYPE |
DISP_E_NONAMEDARGS
Automation target does not accept named arguments
DISP_E_NONAMEDARGS is HRESULT 2147614727 (0x80020007) from winerror.h. AllStat describes it as “No named arguments.” The value must be interpreted at IDispatch::Invoke when DISPPARAMS supplies named DISPIDs, because the same high-level symptom can come from a different contract boundary and require different cleanup.
The decisive interpretation for DISP_E_NONAMEDARGS is that the invoked member supports only positional binding for the current call form. When DISP_E_NONAMEDARGS crosses a language or process boundary, preserve its original numeric form before projections replace it with a broad exception class.
Where the result appears
- DISP_E_NONAMEDARGS is returned while Automation binds or executes IDispatch::Invoke when DISPPARAMS supplies named DISPIDs.
- For DISP_E_NONAMEDARGS, retain the member name and DISPID, invocation flags, LCID, cArgs, cNamedArgs, and the exact VARIANTARG sequence in reverse Automation order.
- The output contract for DISP_E_NONAMEDARGS includes puArgErr, EXCEPINFO, result VARIANT, by-reference values, and SAFEARRAY lock or ownership state; inspect them before cleanup.
Triage of DISP_E_NONAMEDARGS starts by locating the exact owner of the failing state, including object identity, apartment, package, and deployment generation.
Typical causes and interpretation boundary
Common cause categories for DISP_E_NONAMEDARGS are: the caller names ordinary positional parameters; a method lacks named-argument metadata; a property form is invoked with the wrong flags. Do not treat the cause list for DISP_E_NONAMEDARGS as a checklist of simultaneous failures; use traces and postconditions to select the matching branch.
The check that separates DISP_E_NONAMEDARGS from nearby HRESULTs is: the invoked member supports only positional binding for the current call form. A recovery decision for DISP_E_NONAMEDARGS should wait until the decisive condition is observed in call data, component state, or metadata.
Evidence and telemetry
- Record DISP_E_NONAMEDARGS with the object CLSID or ProgID, interface identity, member DISPID, dispatch flags, and type-library version.
- For DISP_E_NONAMEDARGS, capture member DISPID; cNamedArgs; named DISPIDs; invocation flags; type-info parameter attributes.
- Log VARIANT type tags, dimensions, bounds, lengths, and null/empty distinctions for DISP_E_NONAMEDARGS, but redact actual confidential argument values.
- Preserve the caller language/runtime, generated interop version, LCID, and whether the call crossed a process boundary when DISP_E_NONAMEDARGS occurs.
- After DISP_E_NONAMEDARGS, call VariantClear, SysFreeString, SafeArrayDestroy, or release interfaces only for values whose ownership was transferred by the documented contract.
When recording DISP_E_NONAMEDARGS, retain structural metadata and redact content-bearing arguments, authentication material, and personal data.
Diagnostic sequence
- Capture DISP_E_NONAMEDARGS (0x80020007) at IDispatch::GetIDsOfNames or IDispatch::Invoke before the language runtime converts it to a script exception.
- For <code>DISP_E_NONAMEDARGS</code>, resolve the deployed member signature from ITypeInfo and compare its DISPIDs, parameter flags, VARTYPEs, optional values, and property-put rules with the caller.
- Prove the decisive condition for DISP_E_NONAMEDARGS: the invoked member supports only positional binding for the current call form.
- Inspect the likely binding or representation causes for DISP_E_NONAMEDARGS: the caller names ordinary positional parameters; a method lacks named-argument metadata; a property form is invoked with the wrong flags.
- Reconstruct DISPPARAMS exactly, including reverse positional ordering and named argument placement, then reproduce DISP_E_NONAMEDARGS with the smallest value set.
- Verify the result VARIANT, EXCEPINFO, puArgErr, by-reference arguments, SAFEARRAY lock count, and object state after DISP_E_NONAMEDARGS before deciding on retry.
Correct handling and recovery
For DISP_E_NONAMEDARGS, the appropriate recovery is to rebuild the call with positional arguments in reverse order or use the exact named arguments documented for the property operation. A retry policy for DISP_E_NONAMEDARGS needs a bounded attempt count, a state refresh step, and a rule for reconciling work that may already have completed.
Cleanup following DISP_E_NONAMEDARGS must be generation-aware: do not destroy shared state or outputs owned by an earlier successful operation.
Practical scenario
A generic invoker names every argument, but the legacy object accepts only positional values; it switches binding mode for that member.
Coverage for DISP_E_NONAMEDARGS should include the exact failure, a corrected success case, and the closest related HRESULT so classification remains stable.
Difference from related HRESULTs
DISP_E_PARAMNOTFOUND means a particular named argument cannot be found; DISP_E_NONAMEDARGS means named binding is not supported at all.
Tests and telemetry should encode the boundary around DISP_E_NONAMEDARGS so future wrappers do not flatten it into an ambiguous generic exception.
Developer and administrator guidance
Automation adapters should handle DISP_E_NONAMEDARGS at the dispatch boundary and expose the member, parameter, and type information needed to repair the call. A generic retry after <code>DISP_E_NONAMEDARGS</code> with unchanged DISPPARAMS usually repeats the same deterministic binding error.
For DISP_E_NONAMEDARGS, deployment owners should compare the registered type library and server binary as one versioned unit. After <code>DISP_E_NONAMEDARGS</code>, re-registering arbitrary DLLs or changing locale system-wide is inappropriate unless the captured metadata proves registration or LCID drift.
References
- Microsoft: DISPPARAMS — official Microsoft documentation relevant to
DISP_E_NONAMEDARGS. - Microsoft: EXCEPINFO — official Microsoft documentation relevant to
DISP_E_NONAMEDARGS. - Microsoft: VariantClear — official Microsoft documentation relevant to
DISP_E_NONAMEDARGS. - Microsoft: HRESULT values — official Microsoft documentation relevant to
DISP_E_NONAMEDARGS.
Looking for a different code? Search another status or error code.
