CopyMetaFile() Creates Incorrectly Sized Destination

Last reviewed: July 23, 1997
Article ID: Q82232
3.10 WINDOWS kbprg

The information in this article applies to:

  • Microsoft Windows Software Development Kit (SDK) for Windows version 3.1

SUMMARY

When an application calls CopyMetaFile() to create a copy of a metafile, the size of the metafile is listed incorrectly in the destination metafile. The destination size is three words larger than the source metafile.

MORE INFORMATION

The debugging version of Windows 3.1 contains code to validate the size of a memory metafile. This code walks through every record in a metafile and computes the total size. The code compares the computed size with the size listed in the header. If the sizes do not match, the debugging version of Windows displays the following message:

   Metafile has incorrect size

In most cases, this message indicates a corrupted or incorrectly formed metafile. However, this message is also generated as a result of copying an existing metafile due to the problem detailed above.

NOTE: By itself, the "metafile has incorrect size" message is harmless and can be safely ignored. However, under certain circumstances, the debugging version of Windows will also display the following message:

   Metafile is not terminated properly

This message indicates a more serious problem because, as the validation code walked through the array of metafile records, it did not locate a terminator record. An attempt to play an improperly terminated metafile usually results in a General Protection Fault (GP-Fault). To prevent this fault, GDI aborts the call to PlayMetaFile and returns failure.


Additional reference words: 3.10
KBCategory: kbprg
KBSubcategory: GdiMeta
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.