Watching the //BUILD stuff, I saw that WinRT API's can be consumed by C code:
I am rather excited about a fresh C API available to Win32 developers.
Where can I find information on the C WinRT API? How is it better than the existing Win32 C API?
Watching the //BUILD stuff, I saw that WinRT API's can be consumed by C code:
I am rather excited about a fresh C API available to Win32 developers.
Where can I find information on the C WinRT API? How is it better than the existing Win32 C API?
WinRT is fundamentally COM, so using WinRT components from C is like using COM components from C. Like before, you get .idl files for all WinRT components, and also .h files produced from those .idl files. The .h files include both C++ and C declarations (wrapped in
#ifdef __cplusplus
as needed). You can just #include them and start hacking away.It's not exactly neat, though, e.g. something like this C++/CX:
which is equivalent to this vanilla C++:
would be written in C as:
Look inside "C:\Program Files (x86)\Windows Kits\8.0\Include\winrt" in Developer Preview to see the .idl and .h files.