1 / 12

How to Program C ++/ CX

How to Program C ++/ CX. Room metro Tokyo #3 2014/1/18 Sat Sao Haruka. About me. @ hr_sao Community – Osaka Japan Room metro Reading Community - C ++ Templates: The Complete Guide Microsoft MVP for Client Development [(Jan,2010 -)Jan,2013 - Dec,2014] .

holly
Download Presentation

How to Program C ++/ CX

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. How to ProgramC++/CX Room metro Tokyo #3 2014/1/18 Sat Sao Haruka

  2. About me @hr_sao Community– Osaka Japan Room metro Reading Community - C++ Templates: The Complete Guide Microsoft MVP for Client Development [(Jan,2010 -)Jan,2013 - Dec,2014]

  3. Windows Store Apps for C++/CX How to program?

  4. Dev EnvWindowsStoreApps(UI XAML)http://msdn.microsoft.com/ja-jp/library/windows/apps/jj160326.aspx OS process Do not mix. Hazardous. Implimentationclass (C++ native) App container ( package manifest ) UI controls ( XAML ) App-defined ref classes for cross-language interop VSProject Template C++/CX Windows Runtime Win32 and COM STL PPL CRT Windows Kernel Services

  5. Use lambda expression • [] : lambda-capture • () : argument • {} : function - source code • () : call function #include "stdafx.h" #include <string> #include <iostream> int_tmain(intargc, _TCHAR* argv[]) { [ ]( std::string const &str ) // argument { std::cout << str << std::endl; } // define function ( “Hello World!“ ); // call function return 0; } Use lambda to PPL task, STL and so on

  6. Use smart pointers

  7. Automatic type deduction Use return value auto decoder = make_shared<BitmapDecoder^>(nullptr); And Use data collection for (auto file : files) { auto photo = ref new Photo(file, ……); }

  8. Be aware of overhead for type conversion ref class via Platform/Windows namespace For exsample You useas a Windows::Foundation::Collections::Vector^ std::vector vector<AAA^> vec_a; b= ref new Vector<AAA^>(std::move( vec_a )); for move semantics

  9. to understand your app's .winmd output ref class -> on the premise of public ->.winmd that contains metadata for all thepublicreftypes -> beyond the ABI permeter! Don’t expose to unnecessary class To use the ref class for cross-language interop

  10. and so on… http://msdn.microsoft.com/ja-jp/library/windows/apps/jj160326.aspx

  11. Visual C++ CompilerNovember 2013 CTP http://www.microsoft.com/en-us/download/details.aspx?id=41151 Add C++11 Add C++14 Add C++17(?) WinVista/7/8/8.1 http://hilo.codeplex.com/

  12. Let’s C++/CX Life Take care 

More Related