Microsoft KB Archive/890891

= The Visual C++ .NET debugger displays incorrect values in Visual Studio .NET 2003 or in Visual Studio 2005 =

Article ID: 890891

Article Last Modified on 5/18/2007

-

APPLIES TO

 Microsoft Visual C++ .NET 2003 Standard Edition, when used with:  Microsoft Visual Studio .NET 2003 Enterprise Architect

 Microsoft Visual Studio .NET 2003 Enterprise Developer

 Microsoft Visual Studio .NET 2003 Academic Edition

 Microsoft Visual C++ 2005 Express Edition</li></ul> </li></ul>

-

<div class="notice_section">

<div class="symptoms_section">

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.

<div class="cause_section">

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

<div class="resolution_section">

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.

<div class="moreinformation_section">

MORE INFORMATION
For additional information about how to use the extern keyword to specify linkage, visit the following Microsoft Developer Network (MSDN) Web site:

http://msdn2.microsoft.com/en-us/library/0603949d(vs.71).aspx

For more infomation about Visual Studio 2005, visit the following MSDN Web site:

http://msdn2.microsoft.com/en-us/library/0603949d.aspx

Keywords: kbtshoot kbprb KB890891

-

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

© Microsoft Corporation. All rights reserved.