BCB和外部可执行程序通信

Jack_TT 2008-03-05 11:15:56
怎么用BCB调用外部可执行程序并且给这个外部可执行程序参数?
我是菜鸟,希望各位大虾给出具体的使用方法。——谢谢!
...全文
72 8 打赏 收藏 转发到动态 举报
写回复
用AI写文章
8 条回复
切换为时间正序
请发表友善的回复…
发表回复
Jack_TT 2008-03-06
  • 打赏
  • 举报
回复
其实就是我要在BCB里调用ffmpeg.exe用来做视频和音频转换,我应该怎么样调用这个可执行程序并且把转换命令参数传递给这个可执行程序?希望有个例子。
Jack_TT 2008-03-06
  • 打赏
  • 举报
回复
感谢大家,由于老大说用CreateProcess,所以我只能把分给jennyvenus 了,再次表示感谢!其他方法我也会尝试的!谢谢!
Jack_TT 2008-03-06
  • 打赏
  • 举报
回复
谢谢ydlchina。小弟又个过分的要求,能不能给个例子呢?呵呵,麻烦了!
laowang2 2008-03-06
  • 打赏
  • 举报
回复
首先ffmpeg.exe得可以传入参数,然后就是5楼的方法。
ydlchina 2008-03-06
  • 打赏
  • 举报
回复
查一下createprocess资料。
用户 昵称 2008-03-06
  • 打赏
  • 举报
回复
void
OpenDirect( char *dir )
{
STARTUPINFO si;
PROCESS_INFORMATION pi;

ZeroMemory( &si, sizeof(si) );
si.cb = sizeof(si);
si.dwFlags |= STARTF_USESHOWWINDOW;
si.wShowWindow = SW_SHOW;
ZeroMemory( &pi, sizeof( pi ) );

char file[ 300 ] = "Explorer.exe ";
strcat( file, dir );
if( !CreateProcess( NULL, // No module name (use command line).
file, // 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." );
}
}
wangru 2008-03-06
  • 打赏
  • 举报
回复
ShellExecute(NULL,"open","ffmpeg.exe",<参数>,<执行文件所在路径>,SW_SHOW);
CamelFang 2008-03-06
  • 打赏
  • 举报
回复
你先看看MSDN上CreateProcess的用法.

1,221

社区成员

发帖
与我相关
我的任务
社区描述
C++ Builder Windows SDK/API
社区管理员
  • Windows SDK/API社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧