未解析的外部符号Process32First [英] Unresolved external symbol Process32First

查看:74
本文介绍了未解析的外部符号Process32First的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用 WINAPI :: Process32First,WINAPI :: Process32Next,
WINAPI :: CreateToolhelp32Snapsho t函数来获取和迭代我当前正在运行的进程。 

I am trying to use the WINAPI::Process32First, WINAPI::Process32Next, and WINAPI::CreateToolhelp32Snapshot functions to get and iterate through my current running processes. 

这是我的函数

void KillRunningProcess() { std::wstring process; std::wstring compare = L"myprocess.exe"; HANDLE hProcessSnap; PROCESSENTRY32 pe32; hProcessSnap = WINAPI::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS, 0); pe32.dwSize = sizeof(PROCESSENTRY32); //Get first running process Process32First(hProcessSnap, &pe32); while (WINAPI::Process32Next(hProcessSnap, &pe32)) { process = pe32.szExeFile; if(compare == process) { //kill process break; } } CloseHandle(hProcessSnap); }

我在我的文件中包含了tlhelp32.h,但是我收到了以下错误:

3 错误
错误C2059:语法错误:' __cdecl'{log =" C:\ WWINCE700 \Subprojects \\\\\\\\\\\\\\\\\\\\\\\\\\\\\
c:\ wince700 \subprojects \ server \ parser.cpp
310

4 错误
错误C2059:语法错误:'__ cdecl'{log =" C:\WINCE700 \Subprojects \\\\\\\\\\\\ )"}
c:\ wince700 \subprojects\server\parser.cpp
315

5 错误
错误C2143:语法错误:缺少';'之前'{'{log = "C:\ WINCE700 \Subprojects\server \ bldsys.log(33)"}
c:\wince700\subprojects\server\parser.cpp
316

3 Error error C2059: syntax error : '__cdecl' {log="C:\WINCE700\Subprojects\server\bldsys.log(31)"} c:\wince700\subprojects\server\parser.cpp 310
4 Error error C2059: syntax error : '__cdecl' {log="C:\WINCE700\Subprojects\server\bldsys.log(32)"} c:\wince700\subprojects\server\parser.cpp 315
5 Error error C2143: syntax error : missing ';' before '{' {log="C:\WINCE700\Subprojects\server\bldsys.log(33)"} c:\wince700\subprojects\server\parser.cpp 316

我不知道该如何处理。任何帮助将不胜感激。

Im not sure what to do with this. Any help would be appreciated.

谢谢,




推荐答案

快速网络搜索找到:
http://www.masmforum.com/board/index.php?topic=18294.0。
不确定它是否适用于这种情况但是它们也在处理Unresolved External。
A quick web search finds this: http://www.masmforum.com/board/index.php?topic=18294.0. Not sure if it applies in this case but they are also dealing with Unresolved External.


这篇关于未解析的外部符号Process32First的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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