Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi to all,

I have an elementary but severe problem, and excuse myself for the basic question, but I can't argue a solution.
Using VisualC++ 2003 I created a SDI graphic desktop app, based on MFC architecture (running under win XP pro sp3) for data visualization purposes.

Various private members are used to correctly scale and offset math funtions and numerical generated data to be shown in the View, and to keep track of visualization parameters. They are declared in the private section of the appView class, in the .h file, and are initializated in the class costructor (there is only one) in .cpp. Many of them are not successively overwritten. The problem is that they are correctly read and used, but watch window, intellisense and instant commmand window don't detect them as initializated and fail to show correct window, showing "strange" values. Beside, when I assign them to a local variable, the local variable assumes the correct value, but if I try to modify them directly in the same function, they continue to be shown wrong.
I have no warnings or errors

Example:

.int m_YLPrecision \\the number of significtive digits to be shown on the left y axis, declared as private in CView.h and set to 2 in the costructor.

.When used, the axis shows correctly 2 digits.

.When inspected with intellisense or watch in debug, it shows incorrect (and random) values: by now 705. (the first time the variable is used, it always shows -842150451. debug stepping the initialization line in the costructor keeps on showing the same value after the assignation!)

.m_YLPrecision++/-- works correctly: the axis shows 3/1 digits, but intellisense/watch view keeps on showing the incorrect and unmodified(!!) value (in this examples, it keeps on showing 705)

.Making the assignation : int test = m_YLPrecision,
the test variable shows the correct value!!!!!!!!

The same behaviour stands for ALL private members.
Where am I wrong?? I have 0 ideas.
Is it an error of mine (as I suppose), a misconfiguration of the project, a VS2003 issue??
I can use the class members yet, but debugging the app is nearly impossible because of the many local test variables I have to introduce.

Thanks in advance
Posted

Are you using a debug build?
 
 
Share this answer
 
Comments
Sandeep Mewara 5-Jul-10 1:52am    
Should had been a comment instead of an answer!
Hi Stephen, thanks!
Yes, I'm using it, but until two weeks ago it worked perfectly with debug build.
I made various code changes since then that affected only the "mathematical" functions, not the Document/View architecture related ones, but I can't say with confidence when/why this behaviour started, because the app itself worked (and currently works) well!
Beside using other builds is actually really difficult, because the app has not been created "from scratch", but it is a big restyling of a previous version, with various build configurations, but none working..!!
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900