The information in this article applies to:
SYMPTOMSMFC provides a function called GetCurrentMessage that returns a pointer to a MSG structure encapsulating the current message being processed. The MSG structure contains a member variable (pt), of type POINT that contains incorrect values. CAUSEThe GetCurrentMessage function fills in the POINT structure with the following line of code:
This code was correct in the 16-bit version of Visual C++ because a POINT
structure was made up of two intergers (int) that were each 16-bits. Thus
the size of a POINT was the same as a DWORD.
However, in the 32-bit version of Windows and of the Visual C++ compiler, a POINT structure is made up of two LONGs, each 32-bits, so the total size of a POINT is now 64-bits and the above assignment is not valid. RESOLUTIONTo obtain the correct value for the point in the current MSG you can use MFC's overridden CPoint constructor which takes a DWORD as an argument. For example:
Please note that because the GetCurrentMessage function returns a pointer
to a 'const' MSG structure, you can't change the pt member of the message
structure.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual C++ version 2.2. Additional query words: 2.00 2.10 3.00 3.10
Keywords : |
Last Reviewed: January 19, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |