known-folders

SHGetKnownFolderPath / Environment.GetFolderPath() returning wrong value for public documents

核能气质少年 提交于 2019-12-01 00:05:48
问题 I got a somewhat strange error when trying to resolve the CommonDocuments directory. It keeps resolving to the wrong directory, after the CommonDocuments directory has been redirected / moved to a new location using Windows Explorer (Properties->Path from the context menu). a minimal working piece of code would be: namespace CommonDocumentsTest { class Program { private static readonly Guid CommonDocumentsGuid = new Guid("ED4824AF-DCE4-45A8-81E2-FC7965083634"); [Flags] public enum

SHGetFolderPath Deprecated: What is alternative to retrieve path for Windows folders?

旧城冷巷雨未停 提交于 2019-11-29 06:58:21
The SHGetFolderPath() function is deprecated beginning with Windows Vista: http://msdn.microsoft.com/en-us/library/bb762181%28v=VS.85%29.aspx What is the alternative way to retrieve the path to the Application Folder in Windows? SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, 0, szPath) Aside from that, why do I get those errors when using this function: Error 1 error C2065: 'CSIDL_COMMON_APPDATA' : undeclared identifier Error 2 error C3861: 'SHGetFolderPath': identifier not found The alternative is described in the documentation to which you link. Namely it is SHGetKnownFolderPath . However

SHGetFolderPath Deprecated: What is alternative to retrieve path for Windows folders?

邮差的信 提交于 2019-11-28 00:29:08
问题 The SHGetFolderPath() function is deprecated beginning with Windows Vista: http://msdn.microsoft.com/en-us/library/bb762181%28v=VS.85%29.aspx What is the alternative way to retrieve the path to the Application Folder in Windows? SHGetFolderPath(NULL, CSIDL_COMMON_APPDATA, NULL, 0, szPath) Aside from that, why do I get those errors when using this function: Error 1 error C2065: 'CSIDL_COMMON_APPDATA' : undeclared identifier Error 2 error C3861: 'SHGetFolderPath': identifier not found 回答1: The