Angus Leeming wrote: >> Angus, exactly what information are you trying to pull out from the >> machine? Maybe there is another way to get at it, which is more >> portable. > > Asger, I posted some code based on you sample to William and to Luis > late last night. I don't know whether they've replied to that post > yet (can't access home email from work ATM). However, this is all > I'm really interested in: > > char path[PATH_MAX + 1]; > SHGetFolderPath(0, CSIDL_PERSONAL, 0, SHGFP_TYPE_CURRENT, path); > C:\Documents and Settings\Angus\My Documents > > char path[PATH_MAX + 1]; > SHGetFolderPath(0, CSIDL_APPDATA, 0, SHGFP_TYPE_CURRENT, path); > C:\Documents and Settings\Angus\Application Data > > char path[PATH_MAX + 1]; > GetTempPath(PATH_MAX, path); > GetLongPathName(path, path, PATH_MAX + 1); > C:\Documents and Settings\Angus\Local Data\Temp
According to Microsoft, Asger's solution should "just work" on all flavours of Windows >= Win95. http://msdn.microsoft.com/library/en-us/dnw2kcli/html/W2Kcli_chapter4.asp Equivalent URL: http://tinyurl.com/bot2g Indeed, this page http://www.thescarms.com/vbasic/specialfolders.asp also provides a fully-redistributable shfolder.dll (22kB). So, I think that we should be able to use Asger's code and add a comment to the wiki for Win98 users. -- Angus