简体   繁体   中英

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

我听说Windows 8开发将允许XAML / HTML5 + C ++应用程序,但它是原生非托管C ++还是托管C ++(以前称为C ++ .NET)?

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.

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

为了增加Slugart的好答案,您可以为WinRT应用程序(和Java Script)编写非托管C ++,他们也可能将Microsoft的这种能力扩展到Windows Phone 8(目前还不可能) - 这将是一些开发团队的主要合作伙伴,包括我自己的团队。

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM