VC6.0,Win10,C ++。
当我声明线程池回调函数时
VOID CALLBACK ProcessHook(PTP_CALLBACK_INSTANCE instance, PVOID lParam);
我编译它并得到一个错误
错误C2065:“ PTP_CALLBACK_INSTANCE”:未声明的标识符
我已包含Windows.h
代码
#include <Windows.h>
#include <stdio.h>
VOID CALLBACK ProcessHook(PTP_CALLBACK_INSTANCE instance, PVOID lParam);
结果
c:\users\jasey\windows-program\keyboardhook\keyboardhook.h(33) :
error C2065: 'PTP_CALLBACK_INSTANCE' : undeclared identifier
c:\users\jasey\windows-program\keyboardhook\keyboardhook.h(33) :
error C2146: syntax error : missing ')' before identifier 'instance'
c:\users\jasey\windows-program\keyboardhook\keyboardhook.h(33) : warning C4229: anachronism used : modifiers on data are ignored
答案 0 :(得分:1)
您可以从here下载Windows SDK,然后安装或安装via Visual Studio。
从WiKi:
windows.h 是Windows专用的C和C ++编程语言的头文件,其中包含所有 Windows API中的所有函数,Windows使用的所有常见宏 程序员,以及各种函数使用的所有数据类型和 子系统。
如果安装了17134的SDK版本,则可以在以下路径下找到它:C:\ Program Files(x86)\ Windows Kits \ 10 \ Include \ 10.0.17134.0 \ um。
此处,SDK代表Windows软件开发套件。安装后,例如,在控制面板\程序\程序和功能中,您将看到“ Windows软件开发工具包-Windows 10.0.17134.12”。
Windows SDK提供了头文件(例如windows.h),库和工具来帮助您开发Windows应用程序。