What does HRESULT 0x80040069 (DV_E_TYMED) mean?

 
Previous Next
DV_E_LINDEX DV_E_CLIPFORMAT

DV_E_TYMED

Invalid tymed

The native value 0x80040069 is DV_E_TYMED, unsigned 2147745897 and signed -2147221399. The documented description is “Invalid tymed”. Treat it as evidence that the requested TYMED mask cannot be used for this data transfer; the operation in progress is matching FORMATETC::tymed with the medium a source can produce or a destination can accept.

Operational meaning

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 matching FORMATETC::tymed with the medium a source can produce or a destination can accept, rather than from cleanup or a wrapper that ran afterward.

Cause model

  • It can result when the source offers TYMED_ISTREAM but the caller demands TYMED_HGLOBAL.
  • It can result when the mask is zero, contains unsupported flags, or disagrees with STGMEDIUM::tymed.
  • It can result when the destination retains a medium type that is unsafe for cross-process marshaling or the object lifetime.

Troubleshooting workflow

  1. Identify the exact object, method, and lifecycle phase involved in matching FORMATETC::tymed with the medium a source can produce or a destination can accept.
  2. Log both the requested tymed mask and the medium actually returned.
  3. Use EnumFormatEtc or QueryGetData to discover provider combinations.
  4. Verify pUnkForRelease and ReleaseStgMedium ownership for the selected medium.

What to log

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.

Correction strategy

Correction. negotiate one of the source-advertised media and initialize STGMEDIUM consistently with that choice. Retry condition. Retry after changing the medium contract; release any partially returned medium before another attempt. 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

A drag target asks only for TYMED_HGLOBAL, while the source intentionally exposes a large file through TYMED_ISTREAM; accepting the stream avoids copying the payload.

Difference from related HRESULTs

DV_E_STGMEDIUM identifies an invalid transfer container; it identifies the unsupported or contradictory medium kind.

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.