RE: MyDocuments folder
Maybe try something like this:
TCHAR szPath[MAX_PATH];
if (SUCCEEDED(SHGetFolderPath(NULL,
CSIDL_PERSONAL|CSIDL_FLAG_CREATE,
NULL,
0,
szPath)))
{
PathAppend(szPath, _T("FileName.xxx"));
HANDLE hFile = CreateFile(szPath, GENERIC_WRITE|GENERIC_READ,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
.... do something with the new file
}
Mark
--
Mark Salsbery
Microsoft MVP - Visual C++
"Mido1971@hotmail.it" wrote:
hi, i am tring to create folder in MyDocuments, with this function
HANDLE hFile = CreateFile(path,GENERIC_WRITE|GENERIC_READ,
FILE_SHARE_READ|FILE_SHARE_WRITE,
NULL, CREATE_ALWAYS, FILE_ATTRIBUTE_NORMAL, NULL);
where path = _T("%USERPROFILE%\\Documenti") + _T("\\FileName.xxx");
i used ("%USERPROFILE%\\Documenti to get the path of mydocuments but i didnt
find the file ,
i used GetLastError(); where the function tell me the path is incorect
any idea to get the path of mydocuments folder
thanks for help