Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows 8 WinRT - C++ or C++ .NET?

I've heard that Windows 8 development will allow XAML/HTML5 + C++ apps, but is it native unmanaged C++ or managed C++ (formerly C++ .NET) ?

like image 285
Johnny Pauling Avatar asked Jan 15 '23 14:01

Johnny Pauling


1 Answers

The Windows Runtime (WinRT) is itself a native unmanaged framework, but can be called from managed .NET languages in easy way (compared to other native libraries and the infamous P/Invoke).

But besides using it from managed languages it can also be called from C++/CX. This is a Microsoft extension of standard C++ similar to .NET's C++/CLI. But in contrast to the latter it is entirely native unmanaged C++. But it supports some of C++/CLI's extensions, like the ^ operator for "managed-like" pointers. But under the hood those are not actually managed garbage collected pointers, but native reference-counted pointers, similar to say a std::shared_ptr. And it also supports .NET-like properties and delegates, I think, as well as partial classes in order to work with WinRT's XAML framework.

Besides that you can even use WinRT from standard C++ using the so-called Windows Runtime C++ Template Library (WRL), though it is said to be more-cumbersome than with C++/CX and you may not be able to use all features, like easy XAML interfacing, not sure about that.

like image 73
Christian Rau Avatar answered Jan 18 '23 04:01

Christian Rau