我的程序:<br>Function TForm1.WinExecAndWait32(FileName:string; Visibility:integer):integer;<br>var<br> zAppName:array[0..512] of char;<br> zCurDir:array[0..255] of char;<br> WorkDir:string;<br> StartupInfo:TStartupInfo;<br> ProcessInfo:TProcessInformation;<br>begin<br> StrPCopy(zAppName,FileName);<br> GetDir(0,WorkDir);<br> StrPCopy(zCurDir,WorkDir);<br> FillChar(StartupInfo,Sizeof(StartupInfo),#0);<br> StartupInfo.cb:=Sizeof(StartupInfo);<br><br> StartupInfo.dwFlags:=STARTF_USESHOWWINDOW;<br> StartupInfo.wShowWindow:=Visibility;<br> if not CreateProcess(nil,<br> zAppName, //待执行程序名<br> nil, //进程安全级别<br> nil, //线程安全级别<br> false, //继承标志<br> CREATE_NEW_CONSOLE or //创建标志<br> NORMAL_PRIORITY_CLASS,<br> nil, //pointer to new environment block<br> nil, //当前路径<br> StartupInfo, //STARTUPINFO 纪录信息<br> ProcessInfo) then Result:= -1 //PROCESS_INF 纪录信息<br> else begin<br> WaitforSingleObject(ProcessInfo.hProcess,INFINITE);<br> GetExitCodeProcess(ProcessInfo.hProcess,Result);<br> end;<br>end;<br>编译时出错误提示:<br>GetExitCodeProcess(ProcessInfo.hProcess,Result);<br>Type of actual and formal var parameters must be identical<br><br>另外我如果用此函数调用计算器WaitforSingleObject(ProcessInfo.hProcess,INFINITE)没有问题,<br>但调Foxpro的EXE WaitforSingleObject函数会死机,<br>所以我想用waitformultipleobjects函数试试,但参数不太明白。<br>