Can WinRT really be used at just the boundaries?

Posted by Bret Kuhns on Programmers See other posts from Programmers or by Bret Kuhns
Published on 2012-08-07T17:03:58Z Indexed on 2012/10/12 21:48 UTC
Read the original article Hit count: 327

Filed under:
|
|

Microsoft (chiefly, Herb Sutter) recommends when using WinRT with C++/CX to keep WinRT at the boundaries of the application and keep the core of the application written in standard ISO C++.

I've been writing an application which I would like to leave portable, so my core functionality was written in standard C++, and I am now attempting to write a Metro-style front end for it using C++/CX. I've had a bit of a problem with this approach, however. For example, if I want to push a vector of user-defined C++ types to a XAML ListView control, I have to wrap my user-defined type in a WinRT ref/value type for it to be stored in a Vector^. With this approach, I'm inevitably left with wrapping a large portion of my C++ classes with WinRT classes.

This is the first time I've tried to write a portable native application in C++. Is it really practical to keep WinRT along the boundaries like this? How else could this type of portable core with a platform-specific boundary be handled?

© Programmers or respective owner

Related posts about c++

Related posts about portability