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.
精彩评论