Click to See Complete Forum and Search --> : Environment.SpecialFolder.Personal (C#) & CSIDL_PERSONAL (C++) Problem, Win 7


DAaaMan64
December 21st, 2009, 03:56 AM
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:

C++:
CODE
SHGetFolderPath(NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_DEFAULT, path);

And I get: path = "C:\Users\DAaaMan64\Documents"

C#:
CODE
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?

Thanks.

DAaaMan64
December 21st, 2009, 04:24 AM
Problem solved, should be using SHGFP_TYPE_CURRENT instead of SHGFP_TYPE_DEFAULT