Api调用出错(100分)

  • 主题发起人 主题发起人 yl_gz
  • 开始时间 开始时间
Y

yl_gz

Unregistered / Unconfirmed
GUEST, unregistred user!
各位哥哥,小妹这厢有礼了,我在编程过程<br>中遇到一个问题,特向各位大虾请教<br>我在程序中调用了一个API函数<br>createprocess()运行另外一个程序,为什<br>么只能在一些计算机上运行,而一些计算机<br>却报告出错,出错原因是: &nbsp;FCB <br>unavailable,请问各位知道是什么原因吗<br>小妹在次多谢了,<br>急,急,急<br>&nbsp;<br>
 
对于FCB(--File Control Block)可将Config.sys加上<br>Files=40<br>再试一下!
 
最好还是把相关程序片段贴上来看看。<br><br>另外你启动的程序是否带了全路径,如果是,他是否真的在那里?<br>如果不是,他是否在path环境变量中的路径下?
 
我用这段程序在各式windows和机器上都还好,试试?<br>WORD WinExecAndWait32(String CommandLine,int Visibility )<br>{<br>&nbsp; &nbsp; &nbsp; DWORD dwTimeout = 3;<br>&nbsp; &nbsp; &nbsp; DWORD dwRC &nbsp; &nbsp; &nbsp;= WAIT_TIMEOUT;<br>&nbsp; &nbsp; &nbsp; MSG &nbsp; msg;<br>&nbsp; &nbsp; &nbsp; DWORD dw;<br>&nbsp; &nbsp; &nbsp; STARTUPINFO StartupInfo;<br>&nbsp; &nbsp; &nbsp; PROCESS_INFORMATION ProcessInformation;<br><br>&nbsp; &nbsp; &nbsp; ZeroMemory(&amp;StartupInfo, sizeof(STARTUPINFO));<br>&nbsp; &nbsp; &nbsp; StartupInfo.cb = sizeof(STARTUPINFO);<br>&nbsp; &nbsp; &nbsp; StartupInfo.wShowWindow = SW_HIDE;<br><br>&nbsp; &nbsp; &nbsp; ZeroMemory(&amp;ProcessInformation, sizeof(PROCESS_INFORMATION));<br><br>&nbsp; &nbsp; &nbsp; if (CreateProcess(NULL, CommandLine.c_str(), NULL, NULL, NULL, NULL, NULL, NULL, &amp;StartupInfo, &amp;ProcessInformation))<br>&nbsp; &nbsp; &nbsp; {<br><br>&nbsp; &nbsp; &nbsp; &nbsp; // Spin off child process<br>// &nbsp; &nbsp; &nbsp; &nbsp; CloseHandle(ProcessInformation.hProcess);<br><br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (dwRC == WAIT_TIMEOUT)<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; dwRC = WaitForSingleObject(ProcessInformation.hProcess, dwTimeout);<br><br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; while (PeekMessage(&amp;msg, NULL, 0, 0, PM_REMOVE))<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;TranslateMessage(&amp;msg);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;DispatchMessage(&amp;msg);<br>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br><br>&nbsp; &nbsp; return 1;<br>}<br>而且还调用了dos方式的程序。<br>
 
这位JJ,小D这厢还礼了,呵,你调用了什么程序?有些程序用<br>createprocess()就会出现这种情况。
 
各位哥哥,小妹多谢了<br>我已经解决了 这个问题 <br>把 &nbsp;config.sys 加了一句<br>Fcbs=20<br>多谢各位<br>
 
啊,我来晚了!!
 
时间太久,强制结束。 &nbsp; &nbsp; wjiachun
 
后退
顶部