locked
Unmanaged code supported?

    Question

  • With the project wizard of VS2012, the default entry point of a windows store app is App::App() instead of WinMain(). Is it possible we create a windows store app with unmanaged code? Thanks.
    Friday, January 04, 2013 7:13 PM

Answers

  • Ah, you mean Blank App (XAML) which is the only choice under Visual C++ / Windows Store

    That's a C++ XAML application which has start-up defined in App::App(). It is not managed code.

    http://msdn.microsoft.com/en-us/library/windows/apps/hh465045.aspx

    If you want to create an C++ Windows Store app without using XAML, you should use the "Direct3D App" template.

    You basically need to use XAML (or XAML+Direct2D), Direct3D, or a combination for a Windows Store app. Otherwise there's no way for the user to see anything on the screen from your app.



    Friday, January 04, 2013 8:27 PM

All replies

  • Which project template did you use exactly?

    Keep in mind that Windows Store apps use a distinctly different model than Win32 desktop apps. They both have a WinMain, but Windows Store apps use WinRT framework objects rather than Win32 windows and message loops.

    Also, Windows Store apps usually make use of the C++/CX language (/ZW) extensions to consume WinRT APIs. This is syntactically similar looking to Managed C++ (/CLR), but is not in fact managed code at all. There is no CLR running, no .NET Framework in use, and no garbage collection (although there is use of reference counting for lifetime of heap allocated objects).

    http://blogs.msdn.com/b/vcblog/archive/2011/10/20/10228473.aspx

    Friday, January 04, 2013 7:41 PM
  • The template I used is Blank App.

    Friday, January 04, 2013 8:10 PM
  • Ah, you mean Blank App (XAML) which is the only choice under Visual C++ / Windows Store

    That's a C++ XAML application which has start-up defined in App::App(). It is not managed code.

    http://msdn.microsoft.com/en-us/library/windows/apps/hh465045.aspx

    If you want to create an C++ Windows Store app without using XAML, you should use the "Direct3D App" template.

    You basically need to use XAML (or XAML+Direct2D), Direct3D, or a combination for a Windows Store app. Otherwise there's no way for the user to see anything on the screen from your app.



    Friday, January 04, 2013 8:27 PM