Johnny Pauling
Johnny Pauling

Reputation: 13417

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) ?

Upvotes: 4

Views: 1149

Answers (3)

Christian Rau
Christian Rau

Reputation: 45948

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.

Upvotes: 7

MoonKnight
MoonKnight

Reputation: 23833

To add to Slugart's good answer, you are able to write unmanaged C++ for WinRT applications (and Java Script) they are also likely that Microsoft will extend this ability to write unmanaged C++ to Windows Phone 8 also (currently not possible) - which will be a major relef to some development teams, including my own.

Upvotes: 0

Slugart
Slugart

Reputation: 4680

It is unmanaged C++ which you build into WinRT components. These components can then be referenced by your HTML5 or Win8 .NET apps.

Upvotes: 2

Related Questions