The Visual C++ .NET debugger displays incorrect values in Visual Studio .NET 2003 or in Visual Studio 2005 (890891)



The information in this article applies to:

  • Microsoft Visual C++ .NET (2003), when used with:
    • Microsoft Visual Studio .NET (2003), Enterprise Architect Edition
    • Microsoft Visual Studio .NET (2003), Enterprise Developer Edition
    • Microsoft Visual Studio .NET (2003), Academic Edition
    • Microsoft Visual C++ 2005 Express Edition

SYMPTOMS

The Visual C++ .NET debugger displays incorrect values in Visual Studio .NET 2003 or in Visual Studio 2005. You see these incorrect values when you view variables in the Watch window of the Visual C++ .NET debugger.

CAUSE

This problem occurs when the header (.h) file that has the variable declarations is included in multiple source (.ccp) files.

RESOLUTION

To resolve this problem, declare the variable in the .ccp file, and use the extern keyword to specify the external linkage of the variable.

MORE INFORMATION

For additional information about how to use the extern keyword to specify linkage, visit the following Microsoft Developer Network (MSDN) Web site:For more infomation about Visual Studio 2005, visit the following MSDN Web site:

Modification Type:MajorLast Reviewed:1/5/2006
Keywords:kbtshoot kbprb KB890891 kbAudDeveloper kbAudITPRO