代码很简单:char strCmd[MAX_PATH];
strcpy(strCmd, "\"d:\pdftk141\pdftk.exe\" \"D:\\中文\\test1.pdf\" cat 2-5 output \"D:\中文test2.pdf\"");STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcessInfo; ZeroMemory( &ProcessInfo, sizeof( ProcessInfo ) );
ZeroMemory( &StartupInfo, sizeof( StartupInfo ) );
StartupInfo.cb = sizeof(StartupInfo);
if (!CreateProcess( NULL, strCmd,NULL,NULL,FALSE,
CREATE_NO_WINDOW,NULL,NULL,&StartupInfo,&ProcessInfo))
{
DWORD err = ::GetLastError();
MessageBox(_T("进程失败。"), _T("提示"));
return FALSE;
}
WaitForSingleObject ( ProcessInfo.hProcess ,INFINITE );现象是在程序里没有任何响应,在DOS命令行下运行,才出现提示:
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
自己分析可能和当前路径有关,但不确定,请高手看一下。
strcpy(strCmd, "\"d:\pdftk141\pdftk.exe\" \"D:\\中文\\test1.pdf\" cat 2-5 output \"D:\中文test2.pdf\"");STARTUPINFO StartupInfo;
PROCESS_INFORMATION ProcessInfo; ZeroMemory( &ProcessInfo, sizeof( ProcessInfo ) );
ZeroMemory( &StartupInfo, sizeof( StartupInfo ) );
StartupInfo.cb = sizeof(StartupInfo);
if (!CreateProcess( NULL, strCmd,NULL,NULL,FALSE,
CREATE_NO_WINDOW,NULL,NULL,&StartupInfo,&ProcessInfo))
{
DWORD err = ::GetLastError();
MessageBox(_T("进程失败。"), _T("提示"));
return FALSE;
}
WaitForSingleObject ( ProcessInfo.hProcess ,INFINITE );现象是在程序里没有任何响应,在DOS命令行下运行,才出现提示:
This application has requested the Runtime to terminate it in an unusual way.
Please contact the application's support team for more information.
自己分析可能和当前路径有关,但不确定,请高手看一下。
解决方案 »
- 请问为什么recvfrom收不到数据?
- vc如何实现EXE程序的停靠,各位大侠帮忙
- 求一个基于mfc的小程序
- atl生成的dll编译后如何重新编译,除了重启就没有别的方法了?另外如何调试atl生成的.exe?多谢!
- 谁用MSChart做过曲线图??急用!!
- VC中如何调用API动态连接库问题
- 一个有难度的问题(关于COM本质论的)
- 处理菜单的消息该放在那各类下面呢???
- 程序员拿高薪,该!
- @@@@@@各位vc大虾们请进.@@@@@@@@@
- HD audio 是不是没有 Phone Line,Aux Volume,Vidio volum...?
- OnIdle()函数中的while(!PeekMessage(&msg,0,0,0,0))总为0
估计是你的这个写的有问题
CreateProcess前SetCurrentDirectory到d:\pdftk141\pdftk.exe试试。
这个试过一次,确实有用,但pdftk.exe本身并不需要任何依赖库啊