Re: Why can't I see static variables in debug window



Hi Paul, I hope your are doing fine!

Thankyou for answering my post.

Paul:
From what you wrote in the previous post:

"You'll find that, if you're *using* the static in the context where you hit
a breakpoint, the value *is* shown."

Well I must say, unfortunately for me, thats not what happens, its not that
I don't believe you, its just that their must be some setting thats not set
right in my EVC++!

My variable is declared locally in WinProc as a static int, lets call it x.
Okay, therefore, in any code which resides in my handlers where my variable
is existing, I should be able to put a break point on the same line where my
variable exists and when my program hits this break point, I should be able
to view x's value.... right? But I don't ! I tried viewing it with my cursor
over it or by the variables local debug window and no luck.

Having said this, I must point out something on another quote:

"If you change the variables window to show Locals, you'll see it, if it has
local scope."

According to me, x has a local scope, and as I look in my "Locals" tab of my
Variables debug window, the value of the variable x does not show. Is there
some special setting to set in EVC++ to to show Locals?

Anyhow, ... I spent all day on this, and I can't wait to resolve this,
Please get back if you have any other sugestions.

Again, thanks for your time!

--
Kind regards
Rbert


"Paul G. Tobey [eMVP]" wrote:

No, I'd say that microsoft.public.windowsce.embedded.vc is the right place,
since this is an eVC question, but we'll try answering here.

So, you're expecting to see the variable in the Auto version of the
variables window no matter what the context is? You'll find that, if you're
*using* the static in the context where you hit a breakpoint, the value *is*
shown. If you're expecting it to show up when your code isn't using it,
yes, you're out of luck. If you change the variables window to show Locals,
you'll see if, if it has local scope. If it's a global, you can always find
it in the source window and float the mouse cursor over it to see the value.

Paul T.


"Robby" <Robby@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:ED17B518-8547-406C-876F-52EC92FCDB69@xxxxxxxxxxxxxxxx
Hi,

I would like to excuse myself for double posting this question, however I
believe the nature of this question would be better posted in 'Embeded
general questions' for it is more of a general question than a programming
one.

I am a <newbie> to eVC++, and I was wondering why is it that when I am in
debuging mode with the debug and variables watch windows open ayt the
bottom
of the screen, I seem to not be able to view the contents of the variables
that were declared as static?

ex: if I declared a variable like this:

static int cxClient;

and then during the WM_SIZE handler i would like to view cxClient's value
during a debug session like so:

case WM_SIZE:
cxClient = LOWORD (lParam); //I would like to see the variables value!!!
cyClient = HIWORD (lParam);
...
...Other code

But I see all other variables except the ones that were declared 'static'.
Also I can add variables to the Quick watch window, but I can only see the
value of a normal variable but not a static one?

Basically, when I run my app, I click on :

Build> start debug> go

Then the variables screens come on at the bottom of the screen... and as I
say, I can't see any of the variables which are declared static.

Can anyone help me ?

Thanking you in advance!

--
Best regards
Robert
--
Best regards
Robert



.



Relevant Pages

  • Re: Why cant I see static variables in debug window
    ... Auto pane of the variable window, because you're about to use it (to add ... you can use the Locals pane to see everything... ... if you're *using* the static in the context where you ... Variables debug window, the value of the variable x does not show. ...
    (microsoft.public.windowsce.embedded)
  • Re: Why cant I see static variables in debug window
    ... Not only don't I see x in the local debug window but I don't see in the auto ... Best regards ... If you change the variables window to show Locals, ...
    (microsoft.public.windowsce.embedded)
  • Re: Why cant I see static variables in debug window
    ... You shouldn't see it in the Auto window, ... should see it in the locals window. ... Not only don't I see x in the local debug window but I don't see in the ...
    (microsoft.public.windowsce.embedded)
  • Re: Why cant I see static variables in debug window
    ... Paul T. ... HDC hdc; ... Auto pane of the variable window, because you're about to use it (to ... you can use the Locals pane to see everything... ...
    (microsoft.public.windowsce.embedded)
  • Re: Why cant I see static variables in debug window
    ... Best regards ... HDC hdc; ... Auto pane of the variable window, because you're about to use it (to add ... you can use the Locals pane to see everything... ...
    (microsoft.public.windowsce.embedded)