* Prod the inner DataObject with the given format. * * This sets an empty item in the inner DataObject which causes it to register * the existence of the format. This ensures that calls to QueryGetData() and * the IEnumFORMATETC enumeration---both of which are delegated to the inner * object---respond correctly. */
| 257 | * object---respond correctly. |
| 258 | */ |
| 259 | HRESULT CDataObject::ProdInnerWithFormat(CLIPFORMAT nFormat, DWORD tymed) |
| 260 | throw() |
| 261 | { |
| 262 | CFormatEtc fetc(nFormat, tymed); |
| 263 | |
| 264 | STGMEDIUM stgEmpty = STGMEDIUM(); |
| 265 | |
| 266 | // The tymeds in the FORMATETC and STGMEDIUM must match. This was tripping |
| 267 | // up Windows 8 (Consumer Preview) which is stricter about this and was |
| 268 | // returning E_OUTOFMEMORY from SetData. |
| 269 | stgEmpty.tymed = tymed; |
| 270 | |
| 271 | return m_inner->SetData(&fetc, &stgEmpty, true); |
| 272 | } |