FIX: __vfptr Elements Are Not Properly Displayed in Debugger

Last reviewed: September 19, 1997
Article ID: Q150003
The information in this article applies to:
  • The Integrated Debugger included with: - Microsoft Visual C++, 32-bit Edition, versions 4.0, 4.1, 4.2

SYMPTOMS

When you view the theApp variable in an AppWizard-generated MFC application, the element values of __vfptr are not properly displayed in the debugger. For an example, please see the "More Information" section of this article.

RESOLUTION

Drag the address of __vfptr into the memory window, view the data in long-hex format, and notice that the addresses to which the __vfptr variable points appear.

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++ version 5.0.

MORE INFORMATION

Example

  1. Create a default AppWizard MFC application. In the InitInstance(), view the theApp variable in the watch window.

  2. Expand the theApp variable to view the following tree structure:

    theApp

        CWinApp
         CWinThread
          CCmdTarget
           CObject
    
             __vfptr = 0x00405118   // This is correct
    
    
Under Windows NT:
          [0] CXX0030: Error: expression cannot be evaluated
          [1] CXX0030: Error: expression cannot be evaluated
          [2] CXX0030: Error: expression cannot be evaluated
          [3] CXX0030: Error: expression cannot be evaluated
          [4] CXX0030: Error: expression cannot be evaluated

Under Windows 95 (All values are incorrect):
          [0] 0xf000e681
          [1] 0xf000ff47
          [2] 0xf000ff47
          [3] 0xf000ff47
          [4] 0xf000ff47
Keywords          : vcbuglist400 vcfixlist500 WBDebug kbtool
Version           : 4.0 4.1 4.2
Platform          : NT WINDOWS
Issue type        : kbbug
Solution Type     : kbfix


================================================================================


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: September 19, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.