tariq6000
asked on
Rename a file
Hi Experts,
I want to rename my file.When I pass the contant string it is working but when i pass the string using variable it popup a messagebox :
"can't rename file : select only one file to rename , or use MS-DOS wildcard (e.g *.txt) to raname a group of files with similar names"
I writeen the code like this plz check (projecy is unicode enabled)
CString szFilePath,szFileName,szFi leExt,szNe wFilePath;
LPCTSTR lpSourceFileName;
lpSourceFileName=szSourceF ilePath;
SHFILEOPSTRUCT sfo;
ZeroMemory ( &sfo, sizeof (SHFILEOPSTRUCT));
sfo.wFunc = FO_MOVE ;
CString szFN=_T("f:\\pp.txt");
sfo.pFrom =szFN;//lpSourceFileName;/ /+_T("\0\0 ");
sfo.pTo = _T("f:\\pp3.txt\0");
I want to rename my file.When I pass the contant string it is working but when i pass the string using variable it popup a messagebox :
"can't rename file : select only one file to rename , or use MS-DOS wildcard (e.g *.txt) to raname a group of files with similar names"
I writeen the code like this plz check (projecy is unicode enabled)
CString szFilePath,szFileName,szFi
LPCTSTR lpSourceFileName;
lpSourceFileName=szSourceF
SHFILEOPSTRUCT sfo;
ZeroMemory ( &sfo, sizeof (SHFILEOPSTRUCT));
sfo.wFunc = FO_MOVE ;
CString szFN=_T("f:\\pp.txt");
sfo.pFrom =szFN;//lpSourceFileName;/
sfo.pTo = _T("f:\\pp3.txt\0");
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Computer101
EE Admin