Quote:
> Hi all
> Can someone please tell how to watch a static variable when I add a
> breakpoint to the code below at the first if statement and then when the
> breaks drag the static variable Step into the watch window I get the
> following message CXX0017: symbol Step not found. Many thanks.
> BOOL CMyPropertyPage1::StartUp()
> {
> static int Step = 0;
> if(Step == 0)
> {
> SomeFunction();
> Step++;
> }
> else if(Step == 1)
> {
> SomeFunction1();
> Step++;
> }
> else if(Step == 2)
> {
> SomeFunction2();
> Step0;
> }
> }
The scope of Step is the CMyPropertyPage1::StartUp() function. Accordingly,
you should be able to see its value when inside that function but not from
anywhere else. (You can also see it in the Locals window.)
If you can't see the value of Step when inside the function, then I am
mystified. If you are trying to see its value after the function returns,
then you are hoping for too much. The fact that Step retains its value after
the function returns does *not* mean that you should be able to see that
value in the watch window. A variable's storage class (how long it lasts)
and its scope (where it can be accessed from) are distinct (although
somewhat related) properties.
--
Quixote
1. To reply to email address, remove donald
2. Don't reply to email address (post here instead)