SIMPSVR Implements IDataObject::GetData Incorrectly

Last reviewed: July 23, 1997
Article ID: Q114599
2.01 WINDOWS kbole kbprg

The information in this article applies to:

  • Microsoft OLE Libraries for Windows and Win32s, version 2.01

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.


Additional reference words: 2.01
KBCategory: kbole kbprg
KBSubcategory: LeTwoSvr
Keywords : kb16bitonly


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: July 23, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.