Windows 线程池,“PTP_CALLBACK_INSTANCE":未声明的标识符 [英] Windows thread pool, 'PTP_CALLBACK_INSTANCE' : undeclared identifier

查看:30
本文介绍了Windows 线程池,“PTP_CALLBACK_INSTANCE":未声明的标识符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

VC6.0、Win10、C++.

当我声明一个线程池回调函数时

When I declare a thread pool callback function

VOID CALLBACK ProcessHook(PTP_CALLBACK_INSTANCE instance, PVOID lParam);

我编译它并得到一个错误

I compile it and get an error

错误 C2065:'PTP_CALLBACK_INSTANCE':未声明的标识符

error C2065: 'PTP_CALLBACK_INSTANCE' : undeclared identifier

我已经包含了 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

推荐答案

您可以从 此处 然后安装或安装 通过 Visual Studio.

You can download Windows SDK from here and then install or install it via Visual Studio.

来自维基:

windows.h 是 C 和 C++ 编程语言的 Windows 特定头文件,其中包含所有Windows API 中的函数,Windows 使用的所有常用宏程序员,以及各种函数使用的所有数据类型和子系统.

windows.h is a Windows-specific header file for the C and C++ programming languages which contains declarations for all of the functions in the Windows API, all the common macros used by Windows programmers, and all the data types used by the various functions and subsystems.

如果你安装的是17134的SDK版本,你可以在这个路径下找到它:C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\um.

You can find it under this path: C:\Program Files (x86)\Windows Kits\10\Include\10.0.17134.0\um if you install SDK version of 17134.

这里的 SDK 代表 Windows 软件开发工具包.安装后,您将在控制面板\程序\程序和功能中看到Windows 软件开发工具包-Windows 10.0.17134.12",例如.

Here the SDK represent Windows Software Development Kit. After installation, You will see "Windows Software Development Kit-Windows 10.0.17134.12" in Control Panel\Programs\Programs and Features, for example.

Windows SDK 提供头文件(如 windows.h)、库和工具来帮助您开发 Windows 应用程序.

Windows SDK provides header files(like windows.h), libraries and tools to help you to development your windows applications.

这篇关于Windows 线程池,“PTP_CALLBACK_INSTANCE":未声明的标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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