The information in this article applies to:
SUMMARYWhen running the BITMAP.C sample, no problems occur if the code is compiled and run as-is, without modifications. However, many possible symptoms can occur if the user modifies or adds to the code. BITMAP.C contains several calls to the function GetObject(), all of which pass a constant for the cbBuffer parameter, rather than a sizeof(BITMAP); that is
rather than:
Unfortunately, the size of the BITMAP structure under Windows 3.1 is 14 bytes, so each such call to GetObject overwrites the variable after Bitmap. Depending on what that variable is, this code could produce a wide range of erratic behavior.
In the BITMAP.C sample code, the variable following Bitmap is
(Note that both Bitmap and bTrack are global.) Because bTrack is set to
TRUE only while the mouse button is down, and the GetObject calls are done
only during initialization and when a menu item is selected (which can't be
done with the mouse button down), this problem becomes apparent only when
the user modifies the code (for example by adding some other variable after
Bitmap).
Check any code that is based on the old BITMAP.C sample, and replace the constant 16 with sizeof(BITMAP):
Additional query words: 3.10 docerr
Keywords : kbdocfix kbWinOS310 kbDSupport kbSDKWin16 |
Last Reviewed: July 14, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |