C++ createprocess 打开word

#define FileName _TEXT("E:\\DuplicateHandle伪句柄与实句柄的应用.docx")
void CMFCApplication1Dlg::OnBnClickedButton3()
{
STARTUPINFO si = {sizeof(si)};
PROCESS_INFORMATION pi;
TCHAR tcPath[] = _TEXT("\"D:\\Program Files\\Microsoft Office\\Office14\\WINWORD.EXE \"") FileName;//EXE路径+文件名
CreateProcess(NULL, tcPath, NULL, NULL, FALSE, 0, NULL, NULL, &si, &pi);
}

版权声明:本文为博主原创文章,未经博主允许不得转载。

 

posted @ 2014-10-09 19:51  QQ76211822  阅读(409)  评论(0编辑  收藏  举报