PRB: How to Work Around WMFDCODE 64K LimitationLast reviewed: July 23, 1997Article ID: Q94602 |
3.10
WINDOWS
kbprg kbprb
The information in this article applies to:
SYMPTOMSThe sample application, WMFDCODE, supplied in the Windows 3.1 Software Development Kit (SDK) can only read metafiles that are less than 64K in size.
WORKAROUNDTo work around this 64K limitation, add one line and modify two lines. In the file, WMFMETA.C, in the function RenderPlaceableMeta, add this line:
long lBytesRead; // Number of bytes read.Change the "_lread" function to "_hread" to allow the function to use HUGE pointers to read the file. Also, change the return value to lBytesRead so that it can accept a long value:
/* read metafile bits */ lBytesRead = _hread(fh, lpMem, (LONG)(mfHeader.mtSize * 2));Next, change the if statement that compares the value returned from:
if ( lBytesRead with -1 ) {to the following line, which uses long values:
/* if there was an error */ if ( lBytesRead == -1L ) { |
Additional reference words: 3.10
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |