首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 开发语言 > VC/MFC >

关于MFC调用WIN32程序有关问题

2012-03-12 
关于MFC调用WIN32程序问题我在MFC 的ondraw 函数里写的画图程序,然后调用WIN32的程序怎么调用?WIN32的程序

关于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();
[解决办法]
另外一种做法,

C/C++ code
        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." );        } 

热点排行