Visual Studio手表窗口中的问号(???)是什么意思? [英] What do question marks (???) in Visual Studio watch window signify?

查看:581
本文介绍了Visual Studio手表窗口中的问号(???)是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个异常,看着窗口中的变量,我看到一些问号(???)。这是否意味着它指向无效的地址?

解决方案

这意味着调试器无法弄清楚其价值。 p>

例如,如果您的代码涉及 HWND s,那么您会看到这一点。如果您浏览Windows头文件,则通过宏定义如下:

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

所以 HWND 的类型真的是键入指向 HWND __ 的指针。但是,您从 CreateWindow()这样的函数中获取的 HWND值并不实际上指向任何东西。



但调试器将尝试找出结构体中未使用的成员的值,但无法做到:





当观看变量的类型信息不正确或丢失时,您还会看到这些错误。


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?

解决方案

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:

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

这篇关于Visual Studio手表窗口中的问号(???)是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆