我写的一个枚举进程列表的程序,通过快照,可是却一直报错,不只是哪里出的问题,那位朋友帮忙看一下,不胜感激~
#include"TLHELP32.H"void onProcess(){ HANDLE handle =::CreateToolhelp32Snapshot(TH32CS_SNAPPROCESS,0); PROCESSENTRY32 procinfo; procinfo.dwSize = sizeof(PROCESSENTRY32); if(::Process32First(handle,&procinfo){

CString str1 = procinfo.szExeFile; cout<<str1<<endl; do{

CString str2 = procinfo.szExeFile; cout<<str2<<endl; }
while(::Process32Next(handle,&procinfo);

::CloseHandle(handle);

}}运行这段程序的时候报错如下:c:\program files\microsoft visual studio\vc98\include\tlhelp32.h(26) : error C2146: syntax error : missing ';' before identifier 'WINAPI'
c:\program files\microsoft visual studio\vc98\include\tlhelp32.h(26) : error C2501: 'HANDLE' : missing storage-class or type specifiers
c:\program files\microsoft visual studio\vc98\include\tlhelp32.h(26) : fatal error C1004: unexpected end of file found