2

I am writing a Windows Store app with Visual Studio 2015 on Windows 10. My code is as follows:

#define WINVER 0x0A00
#define _WIN32_WINNT 0x0A00
#include <Shlobj.h>

...
HRESULT hr;
 hr= SHGetKnownFolderPath(FOLDERID_LocalAppData, 0, NULL, &tempPath);

I tried to adding above version and header files. still nothing changed. How can I fix this?

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490

2 Answers2

2

According to the documentation of the function, this function is available on the desktop only.

Minimum supported client Windows Vista [desktop apps only]

You are writing a store app, and so the function is not available to you.

David Heffernan
  • 601,492
  • 42
  • 1,072
  • 1,490
  • In documentation, it is mentioned as 'desktop apps only' for Windows Vista. But im using OS Windows 10 – user5159004 Dec 23 '15 at 10:04
  • No, it does not say that. It states that it is for desktop apps only, and for desktop apps the minimum supported platform is Vista. A store app is a store app, and that function is not available to store apps. – David Heffernan Dec 23 '15 at 10:13
  • Yes. thank u. Any idea reg the equivalent for shgetknownfolderpath in Windows App?? – user5159004 Dec 23 '15 at 10:58
  • http://stackoverflow.com/questions/30533869/local-file-storage-during-development-of-a-windows-store-app – David Heffernan Dec 24 '15 at 08:24
0

Please refer to the documentation at MSDN. There, you will find both the required header and the required libs. Also, you will find the minimal system requirements (WINVER etc) that you seem to be aware of already.

Ulrich Eckhardt
  • 16,572
  • 3
  • 28
  • 55