UnWanted Error Show
-
Where's your name file in this code?
-
Hi, There you have just specified two folders name. What happened to the file name. Because its SHFileOperation file operation..
-
TeVc++ wrote:
urgent
For urgentz matterz plz askz CPallini. He willz helpz.
-
Hi All I am useing SHFileOperation.Code is here
void CAbc::OnBnClickedButton1()
{CString pzFrom=\_T("C:\\\\Test\\\\"); CString psTo=\_T("C:\\\\"); CopyFolder(pzFrom, psTo);
}
void CAbc::CopyFolder(LPCTSTR pszFrom, LPCTSTR pszTo)
{SHFILEOPSTRUCT fos ={0};
fos.wFunc = FO_COPY;
fos.pTo = pszTo;
fos.pFrom = pszFrom;::SHFileOperation(&fos);
}
Both Directory exits.I am geting Error this on Dailog Box
Could not find this item
This is no longer in C:\Test\.Verify the Item's location and try again.
I am not to figure out why this is happen.Becouse both directory exits. Plz help me:rose:
Did you try to use flags for SHFILEOPSTRUCT, like
FOF_MULTIDESTFILES
? Did you read the documentation? -
TeVc++ wrote:
Plz help me it's urgent sir..
Of course when you use of this phrase you must be wait for CPallini but your code is working for me:
SHFILEOPSTRUCT p={0}; p.wFunc = FO\_COPY; p.pTo = \_T("c:\\\\"); p.pFrom = \_T("c:\\\\2\\\\1"); SHFileOperation(&p);
You got this error because you use of p.pFrom = _T("c:\\2\\"); but you must be set a name after \\
-
Hi All I am useing SHFileOperation.Code is here
void CAbc::OnBnClickedButton1()
{CString pzFrom=\_T("C:\\\\Test\\\\"); CString psTo=\_T("C:\\\\"); CopyFolder(pzFrom, psTo);
}
void CAbc::CopyFolder(LPCTSTR pszFrom, LPCTSTR pszTo)
{SHFILEOPSTRUCT fos ={0};
fos.wFunc = FO_COPY;
fos.pTo = pszTo;
fos.pFrom = pszFrom;::SHFileOperation(&fos);
}
Both Directory exits.I am geting Error this on Dailog Box
Could not find this item
This is no longer in C:\Test\.Verify the Item's location and try again.
I am not to figure out why this is happen.Becouse both directory exits. Plz help me:rose:
Try this:
LPCTSTR lpFrom = _T("D:\\SymbianDev\\Test\0");
LPCTSTR lpTo = _T("D:\\SymbianDev\\Test1\0");SHFILEOPSTRUCT fos ={0};
fos.wFunc = FO_COPY;
fos.pTo = lpTo;
fos.pFrom = lpFrom;if(::SHFileOperation(&fos) == 0)
cout<<"SHFileOperation succeeded"<<endl;Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]
modified on Friday, October 3, 2008 6:42 AM
-
Try this:
LPCTSTR lpFrom = _T("D:\\SymbianDev\\Test\0");
LPCTSTR lpTo = _T("D:\\SymbianDev\\Test1\0");SHFILEOPSTRUCT fos ={0};
fos.wFunc = FO_COPY;
fos.pTo = lpTo;
fos.pFrom = lpFrom;if(::SHFileOperation(&fos) == 0)
cout<<"SHFileOperation succeeded"<<endl;Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]
modified on Friday, October 3, 2008 6:42 AM
-
One suggestion
Rajesh R Subramanian wrote:
LPCTSTR lpFrom = _T("D:\\SymbianDev\\Test"); LPCTSTR lpTo = _T("D:\\SymbianDev\\Test1");
should end with two null characters At least document says that i don't know if it works without that :)
Regards, Sandip.
Luckily, it works. But that's a good point there. I will modify my previous post.
Many are stubborn in pursuit of the path they have chosen, few in pursuit of the goal - Friedrich Nietzsche .·´¯`·->Rajesh<-·´¯`·. [Microsoft MVP - Visual C++]