Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What do question marks (???) in Visual Studio watch window signify?

I've run into an exception and looking at variables in the watch window, I'm seeing some question marks (???). Does this mean it's pointing to an invalid address?

like image 456
bsh152s Avatar asked Oct 22 '10 21:10

bsh152s


People also ask

What is watch in Visual Studio?

The Watch Window allows you to see value of variables and expressions while debugging. It's kind of like the DataTip you get when hovering over a variable, except that you can write any expression you want. It's available from Debug | Windows | Watch | Watch 1 or Ctrl + Alt + W + 1.

How do I open the Watch window in Visual Studio?

Then CTRL+ALT+W + 1,2,3,4 .


1 Answers

It means that the debugger can't figure out its value.

For example, you see this quite a bit if your code involves HWNDs. If you look through the Windows header files, it's defined like this via a macro:

struct HWND__{int unused;}; typedef struct HWND__ *HWND;

So the type of HWND is really the type "pointer to an HWND__". However, the HWND values you get from functions like CreateWindow() aren't actually pointers to anything.

But the debugger will try to figure out the value of the unused member in the struct, but can't do it:

Watch Window

You will also see these kinds of errors when the watched variable has bad or missing type information.

like image 63
In silico Avatar answered Oct 03 '22 09:10

In silico