473,473 Members | 1,856 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Display wrong value in the watch window

I converted a project from VC6 to VC7. There is a problem in one class
of this dll.
///Class1.h
class CClass1: base class
{
private:
int m_nTest;
public :
void Function1()
}
I access m_nTest in Function1 . Set the value of m_nTest to 8. But I
can not get the correct update in the watch window, still display 0.
But if I set the m_nTest to a temp declared variable, like int n =
m_nTest; then n equals 8(in the watch window). I try to look into the
Disassembly code. I found the address of m_nTest is not the same value
as sum of the class address and the offset(less 8 byte). That means I
can set and get the correct value of this class, but I can not see it
in the watch window. I think the project still has problem and it will
cause other issues sooner or later. So I want anyone give me some
suggestion about it.

Appriciate any of your comments.

Dec 13 '05 #1
4 1117
>I access m_nTest in Function1 . Set the value of m_nTest to 8. But I
can not get the correct update in the watch window, still display 0.


Are you trying to debug an optimised build of your project?

These apparent anomalies are common when you're doing that. Only if
you compile with /Od will the debugger give you a true representation
of the state of variables.

Dave
Dec 13 '05 #2
Dave, Thanks for your reply.

In my debug version, the value of Optimization is disabled (/Od). But
the watch window still displays the uncorrect value.
Do u mean it's ok to use the current code and project settings?

Dec 15 '05 #3
>In my debug version, the value of Optimization is disabled (/Od). But
the watch window still displays the uncorrect value.
In that case, I don't understand why it should.

Can you reproduce this quirk in a simple test project?
Do u mean it's ok to use the current code and project settings?


If the end results you get are correct, you're seeing a quirk of the
debugger, not a real problem.

Dave
Dec 15 '05 #4
Unfortunately, I can not reproduce it in a simple test.

Anyway, thanks you so much.

Dec 18 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Armin Zingler | last post by:
Hello, to reproduce the follwoing steps, "managed DirectX" must be installed. Despite, this is not a DirectX but an IDE problem (at least in VB.Net). As nobody answered in m.p.vsnet.ide and...
4
by: fake | last post by:
What exactly does the line: rGfxOptionsWnd* m_pGfxOptionsWnd; do? I have chased this bug and narrowed it down to something that I believe should not happen and I don't even know what could...
19
by: dmiller23462 | last post by:
Hi guys....I have absolutely NO IDEA what I'm doing with Javascript but my end result is I need two text boxes to stay hidden until a particular option is selected....I've cobbled together the...
6
by: Kenneth Baltrinic | last post by:
I have the following routine that is always throwing the error at the end. It never returns from within the foreach loop because the if expression is always evaluating to false apparently. This is...
2
by: sandeep02 | last post by:
Any help on the follwing would be great. If i have a business object like the folliwng Object Name : Customer PropertyName Value --------------------------- FirstName John...
2
by: Peter Steele | last post by:
Say I have a managed C++ app with some code that looks something like this: void MyMethod() { struct Point { int x, y; }; Point* p = new Point; p.x = 1; p.y = 2;
8
by: Droopy | last post by:
I am making a managed C++ wrapper for calling legacy C++ code from C#. I don't understand what's wrong with following code : __gc public class SerialBuffer { private: unsigned...
6
by: Tau | last post by:
look my simple code below(vc8): double ends; ends=8.3; when i debug it, the variable ends cannot be displayed in the watch window. it just said "error: index '0' out of bound for...
2
by: Gary Brown | last post by:
Hi, In the good old days of Borland C++ the debugger would show a function's return value when single stepping or at a break at the closing '}'. Is there a similar capability in VS 2005? ...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.