WindowsストアアプリをC++/CXで作る

Slides:



Advertisements
Similar presentations
帰ってきた C++ CommunityOpenDay /5/11 Sat Room metro 大阪 遥佐保.
Advertisements

マイクロソフトがホスティングする拡張性に優れたサービス ベース アプリケーション プラットフォーム.
Microsoft VDI 事例とクラウド化. あらためて MS VDI と RDP の進化 3 Windows Server 2012 R2 の標準機能 1 platform 1 experience 4 deployment choices サーバーベースの リモートデスクトップ 旧ターミナル.
この部分こそが必 要とされている ! Runtime 自身と Expression が カバーする!
Windows Azure ハンズオン トレーニング Windows Azure Web サイト入門.
Oscar Koenders Principal Group Program Manager Microsoft Corporation
第28回codeseek勉強会 WPF で簡単ビデオ再生 2008年5月27日(火)
D2-301 現時点の本資料は 完成版のスライドではありません。
MSON-B2 .NET Framework Web アプリケーション開発
Microsoft Consumer Channels and Central Marketing Group
Windows Summit /1/2017 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
Windows Summit /1/2017 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
Windows Summit /1/2017 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
C# Programming .NET / C# Group 検索ワードでみる C#の困り事とその対策
3/2/2017 9:01 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Windows Phone アプリケーションでの データ視覚化
3/3/2017 8:49 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
3/4/ :37 PM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Expression Blend 3で始めるSilverlight 3アプリケーション開発
ParadoxのLiveScripting事情
Using connected devices in Metro style apps Metro スタイル アプリで デバイスを使用する
3/11/2017 7:02 PM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Windows Summit /13/2017 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
MIX 09 3/14/2017 9:51 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Microsoft Consumer Channels and Central Marketing Group
3/17/2017 1:49 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
データはお客様に属し、かつ、コントロール可能
HP ProLiant DL980 G7 SQL Server 2008 R2 NUMA 環境 ベンチマークテスト結果報告書
ビジネスにおける オープンソースの利用価値
XAML の勉強不要! WPF アプリケーションは作れます
大学におけるクラウド活用の 最新動向と先進ソリューションの 事例
3/21/2017 3:39 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Using tiles and notifications タイルと通知の使用
[コース: A1] .NET Framework の基礎
Windows Summit /6/2017 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
Windows Summit /8/2017 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
Windows Azure - 今やるWindows ストアLOB アプリ開発のための設計手法
Windows Summit /9/2017 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
Microsoft Consumer Channels and Central Marketing Group
9/17/ :17 PM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Windows Summit /11/7 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
Microsoft Partner Network Office 365 社内使用ライセンスの有効化
Microsoft Consumer Channels and Central Marketing Group
Azure Pack そして災害対策 日本マイクロソフト株式会社 エバンジェリスト 高添 修
11/9/2018 3:35 AM Windows Azure Platform ハンズオン トレーニング Windows Azure アプリケーション開発概要 ~ Windows Azure 入門編 ~ © 2007 Microsoft Corporation. All rights reserved.
11/16/ :27 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Windows Summit /22/2018 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may.
Windows Summit /11/23 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may.
Windows Summit /24/2018 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may.
Expression Blend 3で始めるSilverlight 3アプリケーション開発
Chad Siefert Senior Test Lead Microsoft Corporation
Windows Azure 通知ハブ.
12/9/ :14 AM © 2007 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
suppose to be expected to be should be
Microsoft Visual Studio 2005 Tools for
.NET Framework 3.0 概要 (旧称 : WinFX)
Windows Summit /21/2019 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
Windows Summit /22/2019 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
MIX 09 2/23/2019 1:22 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Max Morris Principal Program Manager Microsoft Corporation
Windows Summit /24/2019 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
主要関係者の特定用テンプレート Windows 10 and Office 365 導入ステップ 2/24/2019
Yochay Kiriaty Senior Technical Evangelist Microsoft® Corporation
~ 第5回 認証のためのプロキシー Web Application Proxy
Windows Summit /4/10 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
Craig Rowland Senior Program Manager Microsoft Corporation
Microsoft Consumer Channels and Central Marketing Group
Windows Summit 2010 © 2010 Microsoft Corporation.All rights reserved.Microsoft、Windows、Windows Vista およびその他の製品名は、米国 Microsoft Corporation の米国およびその他の国における登録商標または商標です。
Windows Summit /22/2019 © 2010 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be.
Windows Azure メディアサービス
Presentation transcript:

WindowsストアアプリをC++/CXで作る Microsoft Consumer Channels and Central Marketing Group 3/12/2017 WindowsストアアプリをC++/CXで作る Hokuriku.NET vol.12 2013/8/3 Sat 遥佐保(はるか・さお) © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

はじめに

自己紹介 @hr_sao コミュニティ Room metro(大阪) ExceptionalC++読書会(大阪) SQLWorld (大阪) 3/12/2017 自己紹介 @hr_sao コミュニティ Room metro(大阪) ExceptionalC++読書会(大阪) SQLWorld (大阪) Microsoft MVP for Client App Dev  [Jan,2010 - Dec,2013] © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

本日の目的 C++/CXに対する 理解度を深める

注意点 網羅性があるわけではありません 個人の体験と志向に基づきます

Topics How about C++/CX Windows Store Apps grammar How to program 3/12/2017 Topics How about C++/CX Windows Store Apps grammar How to program Problem summary © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

1. How about C++/CX

Now… use cases for C++ メリット 1. Portability LinuxとWindowsで同じコードを動かす 3/12/2017 Now… use cases for C++ メリット 1. Portability     LinuxとWindowsで同じコードを動かす 2. Reusability     既存ライブラリ使いたい 3. Performance      .NETがリッチすぎる こういうところに憧れる…? © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Why Language Extensions? 3/12/2017 Why Language Extensions? 例えば、WindowsでC++を使う人の本音は ファイルの操作、もっと楽に出来ないのかなぁ 表示といえば、MFC/DirectX/GDI…なんでこんなにコーディ ング量多いの…( ̄д ̄) エー いつも「それC#がよしなにやってくれるよ」と言われる Java/C#使いたくない!! そこでC++の拡張です! © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

C++/CX C++言語の拡張 (/ZWオプション) Visual C++ コンパイラの拡張機能です C++11対応 3/12/2017 C++/CX CLIはマネージ CXはネイティブ C++言語の拡張 (/ZWオプション)  Visual C++ コンパイラの拡張機能です  C++11対応  C++/CLI のサブセットに相当します Windows ストアアプリの作成用  ※ストアアプリ以外でも利用可能 Windows Runtime のCOMインタフェースに直接アクセス可能 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2. Windows Store Apps

Windows Store Apps http://msdn. microsoft ウィンドウは1つ タッチUIが快適 アプリ同士の連携 アプリバー・チャームバー タイル

WinRTはAPI – 言語 単なるインタフェース 実体はDLL デスクトップからも呼べるよ※XAML/HTML系以外 3/12/2017 デスクトップからも呼べるよ※XAML/HTML系以外 WinRTはAPI – 言語 単なるインタフェース 実体はDLL Windows store apps Desktop apps C C++ Win32 C# VB .NET SL HTML JavaScript Internet Explorer DirectX XAML JavaScript HTML / CSS C/C++ C#/VB Communication & Data Devices & Printing WinRT APIs Graphics & Media WinRT APIの部分を更に見ていきましょう デスクトップJSからは無理 Application Model Windows Kernel Services © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Windows Runtimeを各言語から利用 3/12/2017 Windows Runtimeを各言語から利用 機能 C++/CX 名前空間 C#/VB JavaScript オブジェクト Windows Runtime Windows ABI互換用 Platform System WinJS JSはWinMD作れないので JSの配列を C++/CX に渡せるよ C++/CX ⇔ C#/VB JavaScript ⇒ C++/CX , C#/VB © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Windows Runtime APIs Application binary Interface (ABI) 3/12/2017 Windows Runtime APIs アプリケーションバイナリインタフェース(ABI) バイナリレベルの互換が保障 ABIを利用してAPIを提供 Application binary Interface (ABI) Windows Runtime APIs Communication & Data Devices & Printing Graphics & Media つまり、Windowsストアアプリのアプリケーションは、全てABIを通じて、直接やり取りが可能です Application Model Windows Kernel Services © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

WinMDで紐付け メタデータを記載している Windows Runtimeの実体はEXEやDLL HKLM\Software\Microsoft\WindowsRuntime\ActivatableClassId

Visual Studio 2012のC++の世界 DirectX apps for phone MFC WRL WTL DirectX 3/12/2017 Visual Studio 2012のC++の世界 Store apps Desktop DirectX apps for phone MFC WRL WTL DirectX XAML for C++ 今までは、XAML for C++(C++/CXメイン)の話。CRL そんなんあったね WTLはWindowsTemplateLibrary – ATL(ActiveTemplateLibrary)というCOMプログラミングを簡単にするためのテ ンプレートベースのライブラリ、ダイアログ、フレーム、GDIなどなど WRLはWindowsランタイムテンプレートライブラリ:Com Windows8 Windows Phone8 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

3/12/2017 (余談)Windows Runtime C++ Template Library (WRL) http://msdn.microsoft.com/ja-jp/library/vstudio/hh438466.aspx WindowsRuntimeのコンポーネントを作成できる テンプレートライブラリ ABIレベルで動作 直接COMアクセスできる C++/CX使わなくてもいい デモ:   ABI::Windows::UI::Notifications C++/CXはWindowsストアアプリ用 デスクトップアプリからトースト通知 © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Windows Kernel Services 3/12/2017 WindowsStoreApps環境(UI XAML) http://msdn.microsoft.com/ja-jp/library/windows/apps/jj160326.aspx OS process 混ぜるな危険! App container ( package manifest ) UI controls ( XAML ) 相互互換のための C++言語拡張機能 (中間の変換無し) C++実装クラス (ネイティブ) VSプロジェクト テンプレート WindowsStoreAppsを取り巻く環境のイメージ図 C++のふりをしているC++/CX 実行環境の中で、アプリが許可されるべき操作を柔軟に制御することができる デスクトップアプリやコンソールアプリでは明示的に出来なかった ビルドインのテンプレートを使う(アイコン、スタンダードスタイルXAML) 例えば、WinRTの機能は何かというと、タッチベースの操作にも対応している C++/CX Windows Runtime Win32 and COM CRT STL PPL Windows Kernel Services © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Access Documents-Pakage.appxmanifest

3. grammar

C++/CXの文法抜粋 http://msdn. microsoft enum class {} Platform::Object^ Platform::String^ T^ 識別子 T% 識別子 ref new

ポインター:^ http://msdn.microsoft.com/ja-jp/library/yk97tc08.aspx 3/12/2017 ポインター:^ http://msdn.microsoft.com/ja-jp/library/yk97tc08.aspx Windows Runtimeオブジェクトへのポインタ C++標準の std::shared_ptr* と同等 参照カウンタを取る コピー可能(所有元をカウント) ムーブ可能(データコピーは発生しない) GC対象 C++の場合、配列/文字列などムーブかコピーか選択出来る ムーブセマンティック © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

3/12/2017 ref new / sealed http://msdn.microsoft.com/ja-jp/library/0w2w91tf.aspx http://msdn.microsoft.com/ja-jp/library/windows/apps/hh699870.aspx Windows Runtimeオブジェクトを割り当て C++標準の new 相当=ref new C++標準の final 相当=sealed ref class Person sealed{ ← Person^ p = ref new Person(); public: Person(); property Windows::Foundation::Metadata:: … } ref クラスのキーワード sealed, 標準の filnal に相当 オーバーライドできない、継承できないクラス © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

文字列:String Windows Runtimeで利用する文字コードはUTF-16 3/12/2017 文字列:String Windows Runtimeで利用する文字コードはUTF-16 内部処理は std::wstring or L“xxx” XAML/外部公開は Platform::String^ // 直接代入 Platform::String^ str1 = “aaa”; // String⇒wstring std::wstring ws1( str1->Data() ); // wstring⇒String Platform::String^ str2 = ref new String( ws1.c_str()); 16bit文字列シーケンス © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

XAML Objを利用可能なpointerに <Button x:Name="btn00" Content="Cleck me :)"/> MainPage.xaml Auto Generated void ::StoreApp1::MainPage::InitializeComponent() { … btn00 = safe_cast<::Windows::UI::Xaml::Controls::Button^> (static_cast<Windows::UI::Xaml::IFrameworkElement^> (this)->FindName(L"btn00")); … } MainPage.g.hpp

4. How to program

ストアアプリでC++を選択したら… MSDN : C++ を使った Windows ストア アプリの ためのロードマップ 3/12/2017 ストアアプリでC++を選択したら… MSDN : C++ を使った Windows ストア アプリの ためのロードマップ http://msdn.microsoft.com/ja-jp/library/windows/apps/xaml/hh700360.aspx WindowsストアアプリのためのC++情報まとめ concurrency::create_async … task – then(), when_all() … casablanca – C++ REST SDK bindings to HTTP, JSON, and URIs 非同期系、ネットワーク系 Concurrency 並列プログラミングフレームワーク 結局コード見て覚えるでしょう © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Hilo http://hilo.codeplex.com/ C++とXAMLを利用するための実践的サンプル 3/12/2017 Hilo Windows7の時はDirectXでした 今はC++/XAML版と、JavaScript版があるよ http://hilo.codeplex.com/ C++とXAMLを利用するための実践的サンプル 学習サンプル © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Hilo C++/CXプログラミングノウハウ 型変換のオーバーヘッドに気を付ける Refクラスは相互運用を目的とする 内部型を public ref クラスで公開しない    …などなど

Casablanca – C++ REST SDK 3/12/2017 Casablanca – C++ REST SDK HiloでWindowsストアアプリの作り方を覚えたら、 次は通信がしたくなる http://casablanca.codeplex.com/ そんなあなたに © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

Casablancaとは RESTサービス(Windows Vista/7/8, Linux) 非同期処理、ストリームバッファ    VS2010/2012, クラウドベースの通信サポート 非同期処理、ストリームバッファ HTTP Client C++11 base Apache オープンソース Azureなど

5. problem

「Windowsストアアプリ用」の設計を 実際には 「Windowsストアアプリ用」の設計を 理解する必要があります

C++という言語を知っているがゆえに、ストア用 設計に頭が切り替わりにくい 3/12/2017 実際やってみると障害 型違いによるコンパイルエラー ネイティブC++型をpublic メンバとするアプリ ケーション設計 だいたいC++のふりしてさ…(*´Д`) そもそもサンプルソースコードや解説が少ない様に感じる 学習してもつまづく部分が多い C++という言語を知っているがゆえに、ストア用 設計に頭が切り替わりにくい Stringなど C#と比べると、XAMLとの兼ね合いなど、歴史の長さが違うしね © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

例)Webから情報をとってきたい #include <pplx.h> 3/12/2017 例)Webから情報をとってきたい public ref class MainPage sealed{ public: MainPage(); private: pplx::task<void> get_http_request(); }; #include <pplx.h> #include <http_client.h> などインクルードしないといけない using namespace concurrency; using namespace pplx; using namespace web::http::client; など宣言しないといけない © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

例)ヘッダファイルに追加したい MainPage.xaml.h にincludeファイルを追加する  →App.xaml.cppでエラーが出る(場合もある) 全てのincludeファイルを pch.h (プリコンパイ ルヘッダ)に固定化ヘッダファイルとして追加 する  →コンパイル時メモリ不足になる(場合もある)

例)何がダメだったのか? MainPage.xaml に 通信処理をまるっと入れようとしたのが 間違い ネイティブで処理できる処理と、 3/12/2017 例)何がダメだったのか? MainPage.xaml に 通信処理をまるっと入れようとしたのが 間違い ネイティブで処理できる処理と、 Windowsストアアプリの処理の境界は? 設計時にきちんと決める必要がある © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

summary

まとめ C++/CXはVisual C++コンパイラの拡張機能 Windows Runtime APIはABI互換 3/12/2017 まとめ C++/CXはVisual C++コンパイラの拡張機能 コンパイルオプションは /ZW Windows Runtime APIはABI互換 C++ネイティブとC++/CXの役割は異なる public 部分→Platform名前空間 情報は多いが、実際には慣れが必要 C++11のムーブセマンティック © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.