"GetProcessIdOfThread":找不到标识符
'GetProcessIdOfThread': identifier not found
这是我的代码 stdafx.h :
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#pragma once
#define _WIN32_WINNT 0x0502
#include "winsock2.h"
#include "windows.h"
#include "stdio.h"
#include "Iphlpapi.h"
#include <psapi.h>
#include "Ntsecapi.h"
#include "txdtc.h"
#include "xolehlp.h"
#include <iostream>
#include <tchar.h>
// TODO: reference additional headers your program requires here
如您所见,我包括了" Windows.h"
这是主要代码:
#include "stdafx.h"
...
if (hThread && dwRpcssPid == GetProcessIdOfThread(hThread))
...
我的错误是:
'getProcessIdofThread':找不到标识符
IntelliSense:标识符" getProcessIdofThread"是未定义的
如何解决这些错误?
_WIN32_WINNT
值小于 0x0600
aka _WIN32_WINNT_VISTA
,该功能不可用。如果您以这种方式更改代码,则可以使其正常工作:
//#define _WIN32_WINNT 0x0502
#define _WIN32_WINNT 0x0600
该功能可用,因为Vista以来,要定位此值,您应该分别定义此值。
针对具有当前SDK的最新版本的API,您可以简单地包含sdkddkver.h,这些值将为您定义/
//#define _WIN32_WINNT 0x0502
#include <SDKDDKVer.h>
另请参见:
- 什么是_WIN32_WINNT,它如何工作?
GetProcessIdOfThread
的平台要求状态:
Windows Vista [仅桌面应用]
Windows Server 2003 [仅桌面应用]
和标题要求指出:
Windows 8和Windows Server 2012上的ProcessThreadSapi.h
so:
- 确保您的Windows SDK是最新的
- 确保您已正确指定了平台要求。
- 确保您包括正确的标题文件。
如果您使用的是Windows 8,则需要包括:ProcessThreadSapi.h
请参阅标题部分中的MSDN引用。
相关文章:
- 设置 Visual Studio for MPI: 找不到标识符错误
- 找不到标识符合并
- 在 c++ 中找不到此函数的标识符
- 从子类访问模板类成员时出现"找不到标识符"错误
- std::p opcount 标识符在 MSVC 16.6.0 中找不到
- OpenCV 3 错误"CV_FOURCC":找不到标识符
- C++ ATL | 找不到_InternalQueryInterface标识符
- im调用函数时找不到标识符?
- clock_gettime:在 Windows 10 的 Visual Studio 中找不到标识符
- 英特尔 TBB - "初始化关键部分 Ex":找不到标识符编译器错误
- 找不到标识符.C3861
- 找不到睡眠标识符 Visual Studio 2017
- 在void tryagain()上找不到标识符
- 找不到内存集标识符
- 在C 类中找不到标识符
- 找不到标识符,尝试在 C++ 中显示数组值
- 找不到QT 5.6 update()函数标识符
- 我遇到:错误2错误C3861:"fx":找不到标识符
- 找不到加载着色器标识符
- OpenGL - 'glTexSubImage3D':找不到标识符