Noggog Posted April 8, 2011 Share Posted April 8, 2011 (edited) Heya, I recently uploaded my mod Dynamic Leveled Lists, and I'm realizing the .exe that's included with it (that i wrote myself) is having issues finding the user's My Documents folders. The code I wrote works for me, and it seems to work with MOST of everyone who has downloaded DLL. But I've gotten two or so complaints, and I'd like to find a better more reliable way to locate the folder. As of now, here is my code that locates the My Documents folder (Yes, I'm fairly new to C++): char pPath[250]; string DLLpath = "\\Documents\\My Games\\Oblivion\\Pluggy\\User Files\\DynamicLL.ini"; char* pPathInit = getenv ("USERPROFILE"); strcpy(pPath,pPathInit); if (pPath!=NULL) { strcat(pPath,DLLpath.c_str()); cout << "Storing FormID data in: " << endl << pPath << endl << endl; outfile.open(pPath); } else { // .... // Code dealing with when it fails to find the My Documents folder } Edited April 8, 2011 by Leviathan1753 Link to comment Share on other sites More sharing options...
Noggog Posted April 8, 2011 Author Share Posted April 8, 2011 (edited) Hmm.. ive also tried doing this: char pPath[250]; string DLLpath = "\\My Games\\Oblivion\\Pluggy\\User Files\\DynamicLL.ini"; SHGetSpecialFolderPath(NULL, pPath, CSIDL_MYDOCUMENTS, 0) ; strcat(pPath,DLLpath.c_str()); Edited April 8, 2011 by Leviathan1753 Link to comment Share on other sites More sharing options...
Noggog Posted April 8, 2011 Author Share Posted April 8, 2011 Still didn't work for a certain someone. It would label the documents folder "Documents" instead of the "My Documents" it should've been. Any help would be appreciated. Link to comment Share on other sites More sharing options...
Hickory Posted April 8, 2011 Share Posted April 8, 2011 Still didn't work for a certain someone. It would label the documents folder "Documents" instead of the "My Documents" it should've been. Any help would be appreciated. I can't help you with the C++ functions, but in Windows Vista the local location IS 'Documents', not 'My Documents'. It can be found by %homepath%\Documents Link to comment Share on other sites More sharing options...
Recommended Posts