December 21st, 2009, 03:56 AM
Environment.SpecialFolder.Personal (C#) & CSIDL_PERSONAL (C++) Problem, Win 7
So I redirected My Documents folder in Win 7. To D:\.
Now I want to get the My Documents folder in a C# app and in a C++ game, I want to get the same file in the same My Documents folder. So I'm doing this:
SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_DEFAULT, path);
And I get: path = "C:\Users\DAaaMan64\Documents"
string path = Environment.GetFolderPath(Environment.SpecialFolder.Personal);
And I get: path = "D:\\"
^^ that is the redirected My Documents folder.
As far as I'm concerned this is a bug.
I'm about ready to just pipe it to the child process. What am I doing wrong?
December 21st, 2009, 04:24 AM
Re: Environment.SpecialFolder.Personal (C#) & CSIDL_PERSONAL (C++) Problem, Win 7
Problem solved, should be using SHGFP_TYPE_CURRENT instead of SHGFP_TYPE_DEFAULT
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.