本文介绍了Windows有自己的“调用其他.exe”函数(C ++)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我知道在C ++有一个函数
I know in C++ there is a function
system("example.exe");运行另一个程序,需要include stdlib.h 。
that runs another program, put it requires the include stdlib.h.
因为我已经包括了'windows.h',是有一个等价的 system c $ c>函数在Windows中?
Because I am already including 'windows.h', is there an equivilant to the system() function in Windows?
推荐答案有 CreateProcess 运行特定的可执行文件,或 ShellExecute 运行程序或打开文档及其关联程序。
There is CreateProcess to run a specific executable, or ShellExecute to run programs or open documents with their associated program.
如果到其他平台的可移植性是任何问题,我会坚持使用系统。 #including stdlib.h不会杀了你;)
If portability to other platforms is any issue at all, I'd stick with system. #including stdlib.h won't kill you ;)
更多推荐
Windows有自己的“调用其他.exe”函数(C ++)
发布评论