Re: How to get "MyDocuments" path of a system?
BOOL CopyFiles(CString Filename,CString To)
{
SHFILEOPSTRUCT FileOpStruct;
char *Temp = new char[Filename.GetLength()+2];
sprintf(Temp,"%s",Filename);
char *Temp1 = new char[To.GetLength()+2];
sprintf(Temp1,"%s",To);
ZeroMemory(&FileOpStruct,sizeof(SHFILEOPSTRUCT));
FileOpStruct.wFunc = FO_COPY;
FileOpStruct.pFrom = Temp;
FileOpStruct.pTo = Temp1;
FileOpStruct.fFlags = FOF_NOCONFIRMATION | FOF_NOCONFIRMMKDIR |
FOF_SIMPLEPROGRESS;
return SHFileOperation(&FileOpStruct) == 0;
}
Example
CopyFiles("C:\\Test\\*.*","C:\\Test2");
AliR.
"donos" <dipuks@gmail.com> wrote in message
news:1156886772.617732.29160@m79g2000cwm.googlegroups.com...
Thank you. That works. Now i can get the MyDocument path.
I used the CreateDirectory function to create a new directory inside
the MyDocuments.
Now i want to copy some text files from another directory inside
ProgramFiles to the newly created directory in MyDocuments. I was
trying to use CopyFile function. Can you tell me how to copy files from
one directory to another?
AliR wrote:
Use SHGetSpecialFolderPath() instead.
AliR.
"donos" <dipuks@gmail.com> wrote in message
news:1156881893.718444.313980@i3g2000cwc.googlegroups.com...
I am using Visual Studio 6.0
WHat is WINVER?
I looked at verion of shell32.dll and that is 6.0
AliR wrote:
Which version of VStudio are you using? What is your WINVER define
set
to?
AliR.
"donos" <dipuks@gmail.com> wrote in message
news:1156878941.577004.158110@m79g2000cwm.googlegroups.com...
I am getting this error: error C2065: 'SHGetFolderPath' :
undeclared
identifier
AliR wrote:
User SHGetFolderPath with CSIDL_MYDOCUMENTS
AliR.
"donos" <dipuks@gmail.com> wrote in message
news:1156868666.689366.301080@74g2000cwt.googlegroups.com...
For example, i have a VC++ application installed in a system
and a
USER
logs in and start using the app. How will i get the
MyDocuments
path
for the particular USER?, If there are multiple USER accounts
in a
system.
Another question i have is,
While using "CopyFile" function i need to copy some files to
MyDocuments folder of the system after creating a folder
inside
it.
How
can i give the path to "MyDocuments"?