我将一个文件路径读到一个CString 类型的变量str中
然后
SHFILEOPSTRUCT fo;
char strSrc[50];
char strDst[50];
int len=str.GetLength();
for(int h=0;h<len;h++)
strSrc[h]=m_modeldisk.GetAt(h);
strSrc[len]='\0';
memset(&fo, 0, sizeof(fo));
fo.wFunc = FO_COPY;//复制是FO_COPY,删除是FO_DELETE;
fo.pFrom = strSrc;
fo.pTo = "d:\\aa";
fo.fFlags = FOF_SIMPLEPROGRESS;
SHFileOperation(&fo);
运行过程中提示“无法读取源文件或磁盘”
请问问题出现在哪?
然后
SHFILEOPSTRUCT fo;
char strSrc[50];
char strDst[50];
int len=str.GetLength();
for(int h=0;h<len;h++)
strSrc[h]=m_modeldisk.GetAt(h);
strSrc[len]='\0';
memset(&fo, 0, sizeof(fo));
fo.wFunc = FO_COPY;//复制是FO_COPY,删除是FO_DELETE;
fo.pFrom = strSrc;
fo.pTo = "d:\\aa";
fo.fFlags = FOF_SIMPLEPROGRESS;
SHFileOperation(&fo);
运行过程中提示“无法读取源文件或磁盘”
请问问题出现在哪?
SHFILEOPSTRUCT fo;
char strSrc[50];
char strDst[50];
int len=strsource.GetLength();
for(int h=0;h<len;h++)
strSrc[h]=m_modeldisk.GetAt(h);
strSrc[len]='\0';
int len1=strdst.GetLength();
for(int k=0;k<len1;k++)
strDst[k]=newpath1.GetAt(k);
strDst[len1]='\0';
memset(&fo, 0, sizeof(fo));
fo.wFunc = FO_COPY;
fo.pFrom = strSrc;//如果只将此句改为fo.pFrom="d:\\YuGuo";程序就能正确运行
fo.pTo = strDst;//如果上面strSrc得到的是错的,那这里不改怎么能行?
fo.fFlags = FOF_SIMPLEPROGRESS;
SHFileOperation(&fo);