Ntk
Ntk

Reputation: 197

How could I know if I'm developing a c++/cx or c++/WinRT UWP application?

I'm creating a c++ UWP application and I want this app to be c++/WinRT because I read that c++/cx is not supported anymore.
And this is how I created my application.
VS 2017 -> File -> New -> Project... -> Visual C++ -> Windows Universal -> Blank App (Universal Windows)

I'm sorry for this basic question but I couldn't find out if my app is a c++/WinRT or not.

Upvotes: 5

Views: 2301

Answers (1)

IInspectable
IInspectable

Reputation: 51345

C++/CX and C++/WinRT do not generate different application types. Even if C++/CX weren't supported anymore (it still is), an application compiled using C++/CX would still continue to run. C++/CX is purely a language-level compiler setting, that generates native code just like C++/WinRT.

You opt in to C++/CX by setting the /ZW (Windows Runtime Compilation) compiler option. If that compiler option isn't present, you aren't using C++/CX. The Blank App (C++/WinRT) project template (available after installing the C++/WinRT Visual Studio extension) doesn't set the /ZW compiler option. The Blank App (Windows Universal), on the other hand, does set the /ZW compiler option.

Upvotes: 5

Related Questions