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.
Asked
Active
Viewed 342 times
0
-
Have a look at http://stackoverflow.com/questions/7436144/using-winrt-from-c – Anthill Nov 27 '12 at 07:26
-
i am not creating a COM component i am creating a library – RanjitRock Nov 27 '12 at 07:38
-
Can you elaborate on what you're trying to do - for instance are you looking for WinRT equivalents to Win32 API calls? – Anthill Nov 27 '12 at 08:43
-
I had a library which was built for win32 but some of the API's are not working in store apps. – RanjitRock Nov 27 '12 at 08:54
-
i need to migrate them to winRT – RanjitRock Nov 27 '12 at 08:55
-
There's no magic way to answer this question. I'd suggest you provide example code of the Win32 API calls you are trying to port to WinRT. – Anthill Nov 27 '12 at 10:25
-
SHGetSpecialFolderPath This fuc is not working with metro apps – RanjitRock Nov 27 '12 at 10:30
1 Answers
1
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.

Anthill
- 1,219
- 10
- 20