VC2005 UNICODE 工程
使用LPCTSTR 定义的参数传递过去就可以用(s和d),但是把CString转换为LPCTSTR 再传递进去就不行了(strS和strD),报1026错误
代码如下,多谢:int CopyData(const CString &strSourcePath, const CString &strDestPath)
{
CString strS, strD;
strS = _T("f:\\test\\*.*\0");
strD = _T("f:\\test2\0");

LPCTSTR s = _T("f:\\test\\*.*\0"); 
LPCTSTR d = _T("f:\\test2\0"); SHFILEOPSTRUCT fileOp;
ZeroMemory(&fileOp, sizeof(SHFILEOPSTRUCT));
fileOp.hwnd = NULL;
fileOp.wFunc = FO_COPY;
fileOp.fFlags =  FOF_SILENT | FOF_NOCONFIRMMKDIR | FOF_NOCONFIRMATION;
fileOp.pFrom = s; //改成strS,就不能用了
fileOp.pTo = d;   //改成strD,就不能用了
fileOp.hNameMappings = NULL;
fileOp.lpszProgressTitle = NULL; return SHFileOperation(&fileOp);
}