C++ 在缓存c+;中找不到CreateProcess应用程序+;MFC
我正在编写一个调用CreateProcess数千次的简单程序,因此运行它需要一段时间。在我的输出窗口中,我每次都会看到此消息C++ 在缓存c+;中找不到CreateProcess应用程序+;MFC,c++,createprocess,C++,Createprocess,我正在编写一个调用CreateProcess数千次的简单程序,因此运行它需要一段时间。在我的输出窗口中,我每次都会看到此消息 application "whatever.exe" not found in cache 我这样叫CreateProcess BOOL result = CreateProcess(NULL, g_minicapcmd, NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS | CREATE_NO_WINDOW, NULL,
application "whatever.exe" not found in cache
我这样叫CreateProcess
BOOL result = CreateProcess(NULL, g_minicapcmd,
NULL, NULL, FALSE, NORMAL_PRIORITY_CLASS | CREATE_NO_WINDOW, NULL, NULL, &startupInfo, &processInformation);
if (!result) {
LPVOID lpMsgBuf;
DWORD dw = GetLastError();
FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS,
NULL, dw, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL);
CString strError = (LPTSTR) lpMsgBuf;
TRACE(_T("::executeCommandLine() failed at CreateProcess()\nCommand=%s\nMessage=%s\n\n"), g_minicapcmd, strError);
LocalFree(lpMsgBuf);
return false;
} else {
// Successfully created the process. Wait for it to finish.
WaitForSingleObject( processInformation.hProcess, INFINITE );
// Close the handles.
CloseHandle( processInformation.hProcess );
CloseHandle( processInformation.hThread );
}
有没有办法让它缓存起来,或者有什么办法让它更快?我已经尝试将.exe加载到ramdisk上,这有点帮助谷歌“应用程序未在缓存中找到”的首要结果是这个问题。你确定你的程序没有打印它吗?我可以看到它是在我跨过CreateProcess时生成的