【发布时间】:2011-01-04 01:12:12
【问题描述】:
我想将一个字符串传递给我的 CreateProcess 函数,以便我可以将此函数用于我的所有操作。如何正确操作?
下面是我的代码:
CString ExecuteExternalProgram(CString pictureName)
{
CString parameterOne = _T(" -format \"%h\" C:\\");
CString filename = pictureName;
CString parameterLast = _T("\"");
CString parameterFull = parameterOne + filename + parameterLast;
CreateProcess(_T("C:\\identify.exe"), parameterFull,0,0,TRUE,
NORMAL_PRIORITY_CLASS|CREATE_NO_WINDOW,0,0,&sInfo,&pInfo);
CloseHandle(wPipe);
.......
}
错误:
错误 2 错误 C2664: 'CreateProcessW' : 无法将参数 2 从 'ATL::CString' 转换为 'LPWSTR' c:\a.cpp
【问题讨论】:
标签: visual-c++