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);
}
使用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);
}
解决方案 »
- VS2010中一运行DockControlBar(&m_newToolBar)就出错
- 磁盘填充工具(含VS2005源代码)
- 关于高精度定时器的问题
- 逐行打印的问题
- 函数定义:void func(UCHAR /*nTTL*/) // typedef unsigned char UCHAR;
- 怎么将两个即将完工的程序和并在一起呀???高分300~~~!!高手请进,大家也可以讨论一下团队如何协作开发
- 虚拟内存耗尽?
- 有没有微软技术的专家,问一个IE编程的问题
- ◎有谁知道下面的两个文件?
- warning C4786,无法disable
- 列表内容存入文本文件出现问题,帮忙看看代码(急急急)在EVC下面编译
- 多对话框的程序如何利用ALT-TAB切换窗口
http://www.codeproject.com/KB/shell/cshellfileop.aspx