开发者

Visual C++ can't find "Windows types" like PVOID, DWORD, ULONG, etc

开发者 https://www.devze.com 2023-03-25 17:48 出处:网络
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

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.

The specific errors I'm getting are:

"<Project Name>.cpp(10): error C2065: 'PVOID' : undeclared identifier

开发者_开发问答

"<Project Name>.cpp(10): error C2146: syntax error : missing ';' before identifier 'varname'

"<Project Name>.cpp(10): error C2065: 'varname' : undeclared identifier

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


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

#include <windows.h>


You need to include a header file to define these types. Double-check the documentation or samples that you got the type names from to see what headers to include.


You have to include the Windows headers. The Windows headers are included in the default auto-generated projects- most of them. If you started an empty project instead, you won't have them included by default.

0

精彩评论

暂无评论...
验证码 换一张
取 消