The information in this article applies to:
SYMPTOMSDeclare a structure type and typedef a pointer to the structure type as follows:
MYSTRUCT is a structure type and PMYSTRUCT is a typedef for a pointer to
MYSTRUCT. Declare and initialize the following variables:
Putting a watch on "(PMYSTRUCT) &var2" produces the following error:
Visual C++ 1.0 and 4.0
Visual C++ 2.xHowever, putting a watch on "(MYSTRUCT *) &var2" is successful. CAUSEThe typedef declares a new name for a type, but it does not define a new type. The typecast attempted in the debugger requires the name of a defined type. RESOLUTIONUse the defined type in the typecast, rather than using the name declared with the typedef. Additional query words:
Keywords : kbDebug kbide |
Last Reviewed: February 2, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |