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

C++中WinExec有些奇怪

2013-04-09 
C++中WinExec有点奇怪?本帖最后由 t101706 于 2013-04-01 14:31:08 编辑#include windows.h //#include

C++中WinExec有点奇怪?
本帖最后由 t101706 于 2013-04-01 14:31:08 编辑


#include <windows.h> //
#include <shellapi.h> 
//win7系统执行以下代码,断点调试模式百试不爽,次次成功。打开debug文件夹,直接双击exe文件,执行以下代码,次次失败,不懂为什么?
if (WinExec("2.bat",SW_HIDE) <32) 
    MessageBox("Can’t WinExec",NULL,MB_OK); 




c++
[解决办法]
debug下和直接点exe运行区别在于,程序的当前路径不一样了。

热点排行