RanjitRock
RanjitRock

Reputation: 1441

How to use Winrt API's in c for creating libraries?

I have an existing C libraries which uses Win32 API but it is not supported in windows 8 metro store apps. I tried calling WinRT API but failed so is there any way ican use WinRT apis in C.

Upvotes: 0

Views: 349

Answers (1)

Anthill
Anthill

Reputation: 1249

Since the question although very general seems to be specifically about SHGetSpecialFolderPath() on WinRT I'll address this:

As you found out WinRT (Metro) apps run in a sandboxed environment which only supports a limited subset of the win32 api.

SHGetSpecialFolderPath is officially deprecated on MSDN and its functionality is not available to WinRT applications. The closest equivalent would be the ApplicationData class. Unfortunately calling it from C is complicated. I would recommend writing a C++ helper which your library could call into.

Upvotes: 1

Related Questions