SIMPSVR Implements IDataObject: GetData Incorrectly (114599)



The information in this article applies to:

  • Microsoft OLE Libraries for Windows and Win32s 2.01

This article was previously published under Q114599
The simple server sample application (SIMPSVR.EXE) included with the OLE 2.01 SDK incorrectly implements the IDataObject::GetData() method. The code checks the cfFormat member of the FORMATEC structure to see if the format is CF_BITMAP. If so, the code continues, filling out the STGMEDIUM with a METAFILEPICT. The code should be comparing the cfFormat with CF_METAFILEPICT.

The sample code continues to work correctly because the STGMEDIUM structure is filled out appropriately for CF_METAFILEPICT. The default handler puts the information into the cache based on the value that is returned, rather than on the value that is requested.

The sample code included with Visual C++ for Windows version 1.5x has been corrected. It now compares against CF_METAFILEPICT.

Modification Type:MinorLast Reviewed:3/3/2005
Keywords:kb16bitonly KB114599