Microsoft KB Archive/143050

= FIX: Cannot Evaluate Structures in Classes =

Q143050

-

The information in this article applies to:


 * The debugger
 * *EDITOR Please do not choose this product*Microsoft Visual C++ 32-bit Edition* use 241, 265, 225, version 4.0

-

SYMPTOMS
The Visual C++ version 4.0 debugger cannot evaluate structures that are defined and declared inside a class when C7-compatible debugging information is generated.

In the Auto window you will get this error:

CXX0030: Error: expression cannot be evaluated.

In the QuickWatch window you will get this error:

CXX0017: Error: symbol "CMyClass::MyStruct" not found.

RESOLUTION
Use the /Zi compiler switch (Program Database) or make the structure definition global.

STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual C++ 4.1.

Sample Code to Reproduce Problem
/* Compile options needed: /Z7
 * 1) include 
 * 1) include 

class CMyClass {   int myInt;

struct MyStruct {       char string[30]; };   MyStruct myStruct; public: CMyClass {       myInt = 5; strcpy(myStruct.string, "Hello"); }  // Set Break Point here };

void main {   CMyClass c; } Additional query words: kbVC400bug 4.00 4.10

Keywords : kbDebug kbide kbVC410fix

Issue type : kbbug

Technology :

Last Reviewed: August 3, 2001

-

[mailto:MSDN@MICROSOFT.COM Send feedback to Microsoft]

© 2002 Microsoft Corporation. All rights reserved.