The third parameter, SHGetSpecialFolderPath() , called lpszPath , is marked as __out .
Something like this should do:
// Beware, brain-compiled code ahead! wchar_t buffer[MAX_PATH]; BOOL result = SHGetSpecialFolderPath( hWnd , buffer , CSIDL_LOCAL_APPDATA , false ); if(!result) throw "You'll need error handling here!"; std::wcout << buffer;
Note. I have not worked for several years. Most likely, someone comes, briefly indicating where I blew him up.
source share