EXEC在MFC中怎么用?作用是什么? EXEC在MFC中怎么用?作用是什么? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 我是想在windows下执行这样的一个命令,调用exec不可以吗?命令是个这个,如下:ebook-convert t.txt t.epub --no-default-epub-cover --base-font-size=10 -v --authors=wabob --comments="just a test" 难道ShellExecute是干这个事情的吗?谢谢。 lz是想在MFC中start 外部的exe程序???用CreateProcess()来启动进程,ShellExecute()太老了,就别用了吧 是的呀,楼上。呵呵用CreateProcess这个函数的话,执行我的那个命令可以吗? 这个函数的后面那些参数,也就是放置我的那些参数了吧? 呵呵。。 WinExec/ShellExecute/CreateProcess都可以.. 真的都可以吗?能不能把代码写出来? 很期望知道代码。谢谢。用createprocess函数就行。 WinExec("ebook-convert t.txt t.epub --no-default-epub-cover --base-font-size=10 -v --authors=wabob --comments=\"just a test\""); #include <windows.h>#include <stdio.h>void main( VOID ){ STARTUPINFO si; PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) ); si.cb = sizeof(si); ZeroMemory( &pi, sizeof(pi) ); // Start the child process. if( !CreateProcess( NULL, // No module name (use command line). TEXT("MyChildProcess"), // 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. ) { printf( "CreateProcess failed (%d).\n", GetLastError() ); return; } // Wait until child process exits. WaitForSingleObject( pi.hProcess, INFINITE ); // Close process and thread handles. CloseHandle( pi.hProcess ); CloseHandle( pi.hThread );}code from msdn 谁能帮忙告诉我一个用C++编写的PING远程主机程序 ****如何突破上传速度***** 请问哪里有《COM技术内幕》CD上的源代码下载? MDI的子窗口(不是主窗口)的背景色,怎么随意改变? 怎么改变ListView行的高度? 视频采集的问题...help me...everbody come here! 怎么使窗口右上角的X按钮无效,也就是变灰无效 十万火急 冰天雪地360'裸体跪求 高手请进,求救,谢谢!!!! 如何实现一点对多点的通讯 SDI中如何显示动态文本?可以绑定基于对话框的程序吗? 请教socket发送文件问题?
呵呵用CreateProcess这个函数的话,执行我的那个命令可以吗? 这个函数的后面那些参数,也就是放置我的那些参数了吧? 呵呵。。
#include <stdio.h>void main( VOID )
{
STARTUPINFO si;
PROCESS_INFORMATION pi; ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
ZeroMemory( &pi, sizeof(pi) ); // Start the child process.
if( !CreateProcess( NULL, // No module name (use command line).
TEXT("MyChildProcess"), // 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.
)
{
printf( "CreateProcess failed (%d).\n", GetLastError() );
return;
} // Wait until child process exits.
WaitForSingleObject( pi.hProcess, INFINITE ); // Close process and thread handles.
CloseHandle( pi.hProcess );
CloseHandle( pi.hThread );
}
code from msdn