Please let me know if there is any alternate CSIDL variables that I
can query or any registry entry that I can query which will return the
My Documents path.
Thanks in Advance ,
Sridhar.
Why not look at the documentation for that function -- at
http://msdn.microsoft.com/en-us/library/bb762204%28VS.85%29.aspx --
and see if there's a flag that might just be really useful when the
path doesn't already exist.
Nathan Mates
--
<*> Nathan Mates - personal webpage http://www.visi.com/~nathan/
# Programmer at Pandemic Studios -- http://www.pandemicstudios.com/
# NOT speaking for Pandemic Studios. "Care not what the neighbors
# think. What are the facts, and to how many decimal places?" -R.A. Heinlein
Hi ,
I need the flag only if I need to create a folder when the path
that does not exist. In this case , the My documents path exists( with
no files in it ) and there is no effect of turning on and off the
flag .
I am looking for alternate shell functions / CSIDL variables or
regtistry entries that will provide me with the My documents path.
Thhanks,
Sridhar.
1) There is no need for "Special"
SHGetFolderPath();
will do just fine.
2) You don´t have to check whether or not a folder already exists,
simply create it either way, that will make the folder if it not
exists, or skip the command if it already exists.
The following is for UNICODE (wstring) if your application needs ANSI
you have to convert it.
TCHAR szPath[MAX_PATH];
if(SUCCEEDED(SHGetFolderPath(0,CSIDL_PERSONAL,0,0,szPath)))
{
wstring BasePath(szPath);
wstring documentspath = BasePath + L"\\MyProgram";
CreateDirectory(documentspath.c_str(),0);
}