| 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. According to AllStat, it means “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.
The high bit in 0x80040069 is set, so this is a failure rather than a success or informational result. Its facility field is 4 (FACILITY_ITF) and its low 16-bit code is 105 (0x0069). Those bit fields classify the value, but they do not identify the failing object by themselves; the native method, object identity, and first producer of DV_E_TYMED remain essential.
Operational meaning
Understanding DV_E_TYMED requires this subsystem context: COM data-transfer structures are compound contracts: a field can be numerically well formed yet invalid for the provider, object generation, requested aspect, or ownership rules. For DV_E_TYMED, diagnosis therefore has to preserve the complete descriptor and the exact method that consumed it.
- Associate
DV_E_TYMEDwith one exact operation in IDataObject, FORMATETC/STGMEDIUM negotiation, data advisory enumeration, or OLE rendering. - Confirm that
DV_E_TYMEDcame 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. - Preserve any IErrorInfo, underlying Win32 result, provider message, or callback failure that preceded
DV_E_TYMED; the HRESULT alone should not erase a more specific cause.
Cause model
DV_E_TYMEDcan result when the source offers TYMED_ISTREAM but the caller demands TYMED_HGLOBAL.DV_E_TYMEDcan result when the mask is zero, contains unsupported flags, or disagrees with STGMEDIUM::tymed.DV_E_TYMEDcan result when the destination retains a medium type that is unsafe for cross-process marshaling or the object lifetime.
Troubleshooting workflow
- Capture
DV_E_TYMEDat the first native return before a wrapper maps it to a generic exception. - 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.
- Log both the requested tymed mask and the medium actually returned.
- Use EnumFormatEtc or QueryGetData to discover provider combinations.
- Verify pUnkForRelease and ReleaseStgMedium ownership for the selected medium.
- Reproduce
DV_E_TYMEDwith one controlled input or state change, and verify that the correction changes the decisive evidence rather than merely hiding the result.
What to log
A useful DV_E_TYMED 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. For DV_E_TYMED, also retain the application and component build, architecture, process and thread IDs, COM apartment, operation correlation ID, elapsed time, and the first state-changing event before the failure. When logging DV_E_TYMED, redact content and credentials while preserving types, lengths, hashes, opaque identities, and lifecycle generations needed to reproduce its contract.
- For
DV_E_TYMED, log both the requested tymed mask and the medium actually returned. - For
DV_E_TYMED, use EnumFormatEtc or QueryGetData to discover provider combinations. - For
DV_E_TYMED, verify pUnkForRelease and ReleaseStgMedium ownership for the selected medium.
Correction strategy
Correction. For DV_E_TYMED, negotiate one of the source-advertised media and initialize STGMEDIUM consistently with that choice. Retry boundary. Retry after changing the medium contract; release any partially returned medium before another attempt. Before repeating the DV_E_TYMED 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. This isolates DV_E_TYMED within COM data transfer and advisory connections and provides a regression test for the stated correction.
Difference from related HRESULTs
DV_E_STGMEDIUM identifies an invalid transfer container; DV_E_TYMED identifies the unsupported or contradictory medium kind. For DV_E_TYMED, keep those outcomes separate in exception mappings, telemetry dimensions, user messages, and automated retry policy.
Developer and administrator guidance
For DV_E_TYMED, copy complete FORMATETC and DVTARGETDEVICE structures, preserve signed lindex values, intersect tymed masks before requesting data, and encode STGMEDIUM ownership explicitly. Regression coverage for DV_E_TYMED 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.
Operational repair for DV_E_TYMED must target the evidence-backed owner: compare the data provider, consumer, and registered handler versions; repair a handler only when traces identify that provider as missing or incompatible. Retain before-and-after traces for DV_E_TYMED so the change can be attributed and reversed.
References
- Microsoft: generic COM error codes — official Microsoft documentation relevant to
DV_E_TYMED. - Microsoft: HRESULT values — official Microsoft documentation relevant to
DV_E_TYMED. - Microsoft: IDataObject — official Microsoft documentation relevant to
DV_E_TYMED. - Microsoft: FORMATETC structure — official Microsoft documentation relevant to
DV_E_TYMED. - Microsoft: IViewObject — official Microsoft documentation relevant to
DV_E_TYMED. - Microsoft: TYMED enumeration — official Microsoft documentation relevant to
DV_E_TYMED. - Microsoft: STGMEDIUM structure — official Microsoft documentation relevant to
DV_E_TYMED.
Looking for a different code? Search another status or error code.
