有个问题~~
bool creatprocess(LPCTSTR lpapplicationname,
LPTSTR lpcommandline,
LPSECURITY_ATTRIBUTES lpprocessattribute,
LPSECURITY_ATTRIBUTES lpthreadattributes,
bool blnherithandles,
DWORD dwcreationflags,
LPVOID llpenvironment,
LPCTSTR lpcurrentdirectory,
LPSTARTUPINFO lpstartupinfo,
LPPROCESS_INFORMATION lpprocessinformation);
DWORD WAITFORSINGLEOBJECT(HANDLE hhandle, DWORD dwmilliseconds);
bool CLOSEHANDLE(
HANDLE hobject
);
bool GETEXITCODEPROCESS(
HANDLE hprocess,
LPDWORD lpexitcode
);
#include<windows.h>
#include<stdio.h>
#define bufsize 1024
void main()
{
DWORD dwexitcode;
PROCESS_INFORMATION pi;
DWORD ret;
STARTUPINFO si={sizeof(si)};
ret=creatprocess(NULL,"calc.exe",NULL,NULL,FALSE,0,NULL,NULL,&si,&pi);
if(ret)
{
WAITFORSINGLEOBJECT(pi.hprocess,infinte);
CLOSEHANDLE(pi.hthread);
GETEXITCODEPROCESS(pi.hprocess,&dwexitcode);
CLSEHANDLE(pi.hprocess);
}
printf(\n进程结束退出码是%ld\n",ret);
}
执行后有错误,说是
error C2065: 'LPCTSTR' : undeclared identifier
error C2146: syntax error : missing ')' before identifier 'lpapplicationname'
帮忙找一下,实在是不知道咋回事!
[此贴子已经被作者于2007-11-13 10:45:29编辑过]