Site icon EfmSoft

What does HRESULT 0x8004006A (DV_E_CLIPFORMAT) mean?

 
Previous Next
DV_E_TYMED DV_E_DVASPECT

DV_E_CLIPFORMAT

Invalid clipboard format

DV_E_CLIPFORMAT has hexadecimal value 0x8004006A (unsigned 2147745898, signed -2147221398). Windows reports “Invalid clipboard format”. The narrow interpretation is that the clipboard format identifier is invalid or unsupported in the current transfer contract. The failing stage is checking FORMATETC::cfFormat for clipboard, drag-and-drop, embedding, or rendering.

API stage

COM data-transfer structures are compound contracts: a field can be numerically well formed yet invalid for the provider, object instance, requested aspect, or ownership rules. Diagnosis therefore has to preserve the complete descriptor and the exact method that consumed it.

  • Associate this result with one exact operation in IDataObject, FORMATETC/STGMEDIUM negotiation, data advisory enumeration, or OLE rendering.
  • Confirm that this result came from checking FORMATETC::cfFormat for clipboard, drag-and-drop, embedding, or rendering, rather than from cleanup or a wrapper that ran afterward.

Verification steps

  1. Identify the exact object, method, and lifecycle phase involved in checking FORMATETC::cfFormat for clipboard, drag-and-drop, embedding, or rendering.
  2. Translate registered IDs back to names with GetClipboardFormatName where possible.
  3. Compare the format with EnumFormatEtc output from the same IDataObject.
  4. Capture whether the ID came from RegisterClipboardFormat, a constant, persistence, or IPC.

Interpretation limits

  • It can result when cfFormat is zero where a real format is required.
  • It can result when a private registered format was not registered in this session or its numeric ID was persisted across boots.
  • It can result when the caller requests text, bitmap, or object data under a format the source does not advertise.

Incident record

A useful incident records the IDataObject identity, method, clipboard format, aspect, lindex, tymed mask, target-device size, advisory cookie, and ownership of every returned interface or medium.

Recovery conditions

Correction. register or select the intended format at runtime and request it together with a compatible aspect and tymed. Retry condition. Retry only after resolving the format identity; numeric reuse without the registered name is not evidence of equivalence. Before repeating the operation, release every returned STGMEDIUM according to pUnkForRelease, retain advisory cookies only after successful DAdvise, and discard enumerated formats after the data object is replaced.

Practical scenario

An application stores the numeric value of a custom clipboard format in a settings file; after reboot the value refers to a different registration, so using the format name at startup fixes the request.

Difference from related HRESULTs

DV_E_FORMATETC rejects the descriptor as a whole, whereas it isolates cfFormat as the decisive field.

Developer and administrator guidance

Copy complete FORMATETC and DVTARGETDEVICE structures, preserve signed lindex values, intersect tymed masks before requesting data, and encode STGMEDIUM ownership explicitly. Regression coverage should include provider-advertised versus caller-invented formats, supported and unsupported DVASPECT/tymed combinations, sentinel lindex values, malformed target-device sizes, and replacement during advisory callbacks.

Compare the data provider, consumer, and registered handler versions; repair a handler only when traces identify that provider as missing or incompatible.

References


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

Exit mobile version