02-18-2011 05:58 AM
Hi all
I am trying to set the current directory to the users my documents.
How do i do this without know who the knowing who the user is?
The windows Enviroment Variable %HOMEPATH%.
I there a way i could implement this ?
Kind Regards
Shakeel
02-18-2011 08:28 AM
try GetProjectDir and MakePathname 🙂
02-18-2011 10:41 AM
Try this:
#include "shlobj.h"
char file[MAX_PATHNAME_LEN];
SHGetFolderPath (NULL, CSIDL_PERSONAL, NULL, SHGFP_TYPE_CURRENT, file);
You need to have SDK installed and add ShFolder.lib to your project.
Look into SDK documentation for a reference on the function and see this thread for some additional informations.
02-18-2011 10:51 AM
Roberto,
the link you specified does not work for me... (probably I have a different page setting than you - Lithium bug?)
Here is the more general link without page information: http://forums.ni.com/t5/LabWindows-CVI/A-better-way-to-get-AppData-location/m-p/795070