关于MFC调用WIN32程序问题
我在MFC 的ondraw 函数里写的画图程序,然后调用WIN32的程序怎么调用?WIN32的程序是一个独立的程序。
[解决办法]
HINSTANCE ShellExecute( HWND hwnd,
LPCTSTR lpOperation,
LPCTSTR lpFile,
LPCTSTR lpParameters,
LPCTSTR lpDirectory,
INT nShowCmd
);
[解决办法]
CreateProcess or ShellExecuteEx
[解决办法]
system(“exe”),挺好用的,希望能给lz帮助
[解决办法]
一般用ShellExecute();
[解决办法]
ShellExecute
[解决办法]
ShellExecute();
[解决办法]
另外一种做法,
STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); si.dwFlags |= STARTF_USESHOWWINDOW; si.wShowWindow = SW_SHOWMAXIMIZED; ZeroMemory( &pi, sizeof( pi ) ); strcat( exe, g____space ); strcat( exe, filename ); // Start the child process. if( !CreateProcess( NULL, // No module name (use command line). exe, // Command line. NULL, // Process handle not inheritable. NULL, // Thread handle not inheritable. FALSE, // Set handle inheritance to FALSE. 0, // No creation flags. NULL, // Use parent's environment block. NULL, // Use parent's starting directory. &si, // Pointer to STARTUPINFO structure. &pi ) // Pointer to PROCESS_INFORMATION structure. ) { AfxMessageBox( "CreateProcess failed." ); }