hi, i have some old code from win2000 days
it uses this code
if(!SHGetSpecialFolderLocation( 0, CSIDL_PERSONAL, &pidl ) ){
if(SHGetPathFromIDList( pidl, path ) ){
rootPath = path;
}
}
to get the path to My Documents and has worked fine for a long time
now when i compile and run it, it returns the path 'C:\Users\steve\Documents'
however, a quick look in C:\Users\steve shows that the folder is called 'My Documents' (note, i'm on windows 7, standard installation as far as i can remember)
if i go to the start menu and select Documents, i get to Libraries\Documents which in reality is exactly the same place as 'C:\Users\steve\My Documents'
but at no point in any of this is does 'C:\Users\steve\Documents' seem to exist
this is a problem when i try to open a file with fopen with a path 'C:\Users\steve\Documents\myfile.txt' or whatever
interestingly, i have a file tree app that takes the root path the above code and it works file, it finds all the files
CFileFind finder; finder.FindFile( root+_T("*.*") );
so i'm very confused, i realize this is microsoft playing mind games with me, i'm just looking for a way to get a real path to the Documents folder
UPDATE:
Solved by OP himself - posted as one of the answers.