I'm using Visual Studio 6.0 for C++ and while I'm stepping through my code in Debug mode, I'm not able to view any of my static variables in the "Locals" section of the context window. I know there has to be a way to set this up, as the computers I use at my school allow for it.

Any ideas on how exactly I can set up my Debug mode so that I can view these?

Recommended Answers

All 5 Replies

Add them to your watch list, or view them from the "Autos" section.

Add them to your watch list, or view them from the "Autos" section.

A solution this simple is kind of what I was afraid of. Maybe I turned something off by default in my compiler?

I can't add them to my watch list, because they're not in my context list. Not anywhere in my context list. Not in Autos, or Locals, or this. That is the base of my problem: I want them in the context list so I can add them to Watch.

The only way I can view the static variables now is by declaring new variables that constantly equal their value (the types in question are an int and character pointer). The issue here is I would have to do this EVERYWHERE in my code, which is just too much.

>I want them in the context list so I can add them to Watch.
They don't have to be in your context list. Just type them into the watch list manually. For certain objects this will fail, but static or global objects will typically come up if you get the name right.

>I want them in the context list so I can add them to Watch.
They don't have to be in your context list. Just type them into the watch list manually. For certain objects this will fail, but static or global objects will typically come up if you get the name right.

Beautiful. For some reason I feel like I tried doing that before, but obviously not. Thank you very much, El Lifesavero.

I and others here are having the same problem (Visual C++ 6.0) and none of the solutions offered here have ever worked. If I type a static int (example "CMode") into a watch window I get "CX0017: Error: symbol "CMode" not found

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.