1

I've seen on this page that temporary variables can be declared in MSVS.

Here is another Tricks (sic), you can use some “temp” variable to store those data. But you have to declare the variable at “Immediate Window”. [ Please read Tips 3 to know more about using Immediate window with Watch Window ]

However, this doesn't appear to actually work. If I were to do this for instance:

int test;

I get a type name is not allowed. If I do this:

CString s;

I get an identifier "s" is undefined.

Looking at Tip 3 doesn't appear to help.

Considering that this article is dated 2010, I'm assuming that this is for MSVS 2010, but I'd like to get this to work for MSVS 2013.

Adrian
  • 10,246
  • 4
  • 44
  • 110
  • What language are you using? – Cameron Jul 02 '14 at 21:37
  • I'm using C++. But it would be good if I could do this for any language that the MSVS debugger can handle. – Adrian Jul 02 '14 at 21:38
  • Ah well, there you go. The C++ debugger is not nearly as powerful as the .NET one (mostly because there's a lot less leeway in terms of dynamic code compilation). – Cameron Jul 02 '14 at 21:39
  • Is there a link from MS stating that this is not possible to do? – Adrian Jul 02 '14 at 21:40
  • This seems to be a duplicate of [VS Immediate Window for C++ Declarations](http://stackoverflow.com/questions/15648455/vs-immediate-window-for-c-declarations). I don't know of any official documentation stating as much, but I'm fairly certain it's not supported. The debug engines are different behind the scenes. – Cameron Jul 02 '14 at 21:46
  • By checking off _Enable native Edit and Continue_, it disables the _data viewing enhancements_ i.e. [data natural visualization](http://code.msdn.microsoft.com/Writing-type-visualizers-2eae77a2) which is not acceptable. :( Also, in some cases, e.g. debugging a .dll, this will not work esp if the .dll is in use elsewhere (I've run in to this problem). – Adrian Jul 04 '14 at 18:06

0 Answers0