Visual C++ 找不到“Windows 类型";像 PVOID、DWORD、ULONG 等 [英] Visual C++ can't find "Windows types" like PVOID, DWORD, ULONG, etc

查看:34
本文介绍了Visual C++ 找不到“Windows 类型";像 PVOID、DWORD、ULONG 等的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Windows 似乎无法找到任何这些类型,我完全不知道该怎么做.我在 MSDN 上发现的内容似乎表明它们默认包含在内,但它们在本机程序或 CLR 程序中不起作用.

Windows can't seem to find any of these types, and I'm completely at a loss for what to do. The things I've found on MSDN seem to suggest that they're included by default, but they haven't worked in Native programs or CLR programs.

我得到的具体错误是:

".cpp(10): error C2065: 'PVOID' : 未声明的标识符

"<项目名称>.cpp(10):错误 C2146:语法错误:缺少 ';'在标识符 'varname' 之前

".cpp(10): error C2065: 'varname' : 未声明的标识符

如何让 Visual C++ 识别这些类型?

How can I make Visual C++ recognize these types?

推荐答案

您需要包含 windows.h.在源文件的顶部添加这一行:

You will need to include windows.h. Add this line at the top of your source file:

#include <windows.h>

这篇关于Visual C++ 找不到“Windows 类型";像 PVOID、DWORD、ULONG 等的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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