SlideShare une entreprise Scribd logo
1  sur  41
Metro style apps
View                          Metro style Apps                        Desktop Apps

                              XAML                      HTML / CSS
Controller




                        C                C#             JavaScript
 Model




                                                                      HTML         C      C#
                       C++               VB              (Chakra)     JavaScrip
                                                                          t       C++     VB
                                    WinRT APIs
  System Services




                    Communication      Graphics &         Devices &
                       & Data            Media             Printing

                                    Application Model                 Internet            .NET
                                                                      Explorer
                                                                                  Win32    / SL
  Core




                                     Windows Core OS Services
The Sweet Spot for C++…
  Power,
    Performance
      and Portability.
XAML
Demo
Language Basics
1.   Person^ p = nullptr;
2.   {
3.       Person^ newP = ref new Person();   //   refcount   =   1
4.       newP->Name = “John”;               //   refcount   =   1
5.       p = newP;                          //   refcount   =   2
6.   }                                      //   refcount   =   1
7.   p = nullptr;                           //   refcount   =   0; ~Person()
Key Bindings    Feature           Summary
1. Data Types   ref class         Reference type
                value class       Value type
                interface class   Interface
                property          Property with get/set
                event             “Delegate property” with add/remove/raise
                delegate          Type-safe function pointer
                generic           Type-safe generics
2. Allocation   ref new           Reference-counted allocation
3. Pointer &    ^                 Strong pointer (“hat” or “handle”)
Reference       %                 Strong reference
More Language
1. delegate void CarouselInitDoneHandler(IUIAnimationVariable^ rotation);
2. void CarouselAnimation::Initialize(double angle, CarouselInitDoneHandler^ callback) {
3.      // Create Animation Manager
4.      using namespace Engine::Graphics;
5.      UIAnimationManager animationManager;
6.      // Create rotation animation variable
7.      IUIAnimationVariable^ rotation = animationManager.CreateAnimationVariable(angle);
8.      // Set the event handler for the story board
9.      rotation->GetCurrentStoryBoard()->SetStoryBoardEventHandler(
10.                 ref new CarouselStoryBoardHandler(this, CarouselAnimation::StoryBoard)
11.              );
12.      // Invoke the callback when done
13.      callback(rotation);
14. }
public ref class Person {
    public:    Person(String^ name, String^ email);
               void Greet(Person^ other);
    internal: ~Person();
               void SetPassword(const std::wstring& passwd);
};




Person^ p = ref new Person(“John Surname”);
p->Greet(ref new Person(“Jim Surname”);
public interface class IAnimal {   public interface class IFeline :
    void Play();                   IAnimal {
};                                     void Scratch();
                                   };



IAnimal^ animal = ref new Cat();   ref class Cat : IFeline {
animal->Play();                        public: virtual void Play();
                                                  virtual void Scratch();
                                   };
public ref class DatabaseConnection {
    public: ~ DatabaseConnection();
};


{
    DatabaseConnection db();
    db.SetName( “Employees”);
    // …
    // … lots of queries, updates, etc. …
    // …
}        // ~DatabaseConnection()
public:   property String^ Name;

public:  property Person^ Sibling {
           Person^ get() { InitSiblings(); return _sibling; }
           void set(Person^ value) { _sibling = value; NotifySibling(); }
         }
private: Person^ _sibling;



      Person^ p = ref new Person(“John”);
      p->Sibling = ref new Person(p->Name);
public delegate void PropertyChanged( String^ propName, String^ propValue );



  auto p = ref new PropertyChanged(
        [](String^ pn, String^ pv) {
              cout << pn << ” = “ << pv;
        } );

  auto p = ref new PropertyChanged( UIPropertyChanged );

  auto p = ref new PropertyChanged( this, MainPage::OnPropertyChanged );


          p( “Visible”, false );
public: event PropertyChanged^ OnPropertyChanged;

public: event PropertyChanged^ OnNetworkChanged {
     EventRegistrationToken add(PropertyChanged^);
     void remove(EventRegistrationToken t);
     void raise(String^, String^);
}


person->OnPropertyChanged += propertyChangedDelegate;
auto token = person->OnPropertyChanged::add(propertyChangedDelegate);

    person->OnPropertyChanged -= token;
    person->OnPropertyChanged::remove(token);
HRESULT               Exception
                                                E_OUTOFMEMORY         OutOfMemoryException
                                                E_INVALIDARG          InvalidArgumentException
                                                E_NOINTERFACE         InvalidCastException
                                                E_POINTER             NullReferenceException
                                                E_NOTIMPL             NotImplementedException
                                                E_ACCESSDENIED        AccessDeniedException
throw ref new InvalidArgumentException();       E_FAIL                FailureException
throw ref new COMException(E_*);                E_BOUNDS              OutOfBoundsException
                                                E_CHANGED_STATE       ChangedStateException
                                                REGDB_E_CLASSNOTREG   ClassNotRegisteredException

try { … } catch (OutOfMemoryException^ ex) E_DISCONNECTED
                                            { … }
                                           E_ABORT
                                                                      DisconnectedException
                                                                      OperationCanceledException
                       ex->HResult

• catch (Platform::Exception^)
generic<typename T, typename U>               ref class PairStringUri:
public interface class IPair {                      IPair<String^, Uri^> {
   property T First;                          public:
   property U Second;                            property String^ First;
};                                               property Uri^ Second;
                                              };


IPair<String^, Uri^>^ uri = GetUri();
auto first = uri->First; // type is String^
auto second = uri->Second; // type is Uri^
template<typename T, typename U>
ref class Pair: IPair<T, U>
{
public:
  property T First;
  property U Second;

  Pair(T first, U second) {   First = first; Second = second; }
};

IPair<String^, Uri^>^ pair = ref new Pair<String^, Uri^>(
       “//BUILD/”, ref new Uri(“http://www.buildwindows.com”));
#using <Company.Component.winmd>




     public
private partial ref class MainPage: UserControl, IComponentConnector
{
public:
    void InitializeComponent();
    void Connect() { btn1->Click += ref new EventHandler(this, &MainPage::Button_Click); }
};



ref class MainPage
{
public:
    MainPage() { InitializeComponent(); }
    void Button_Click(Object^ sender, RoutedEventArgs^ e);
};
Libraries
using namespace Platform;
      Vector<String^>^ items = ref new Vector<String^>();



      items->Append(“Hello”);

•   Returning a read-only view of the vector
      IVectorView<String^>^ GetItems () {
          return items->GetView();
      }



                 items->VectorChanged +=
                        ref new VectorChangedEventHandler<String^>
                                (this, &MyClass::VectorChanged);
using namespace Platform;
Map<String^, Uri^> favorites = ref new Map<String^, Uri^>();



favorites->Insert(“MSDN”, ref new Uri(“http://msdn.com”));



if (favorites->HasKey(“MSDN”))
    favorites->Remove(“MSDN”);
Begin()/End()

                                   std::vector<int> v;
          begin()    end()         v.push_back(10);
                                   auto items = ref new Vector<int>(v);
IVector<int>^ v = GetItems();
int sum = 0;                       Vector<int>^ items = …;
std::for_each( begin(v), end(v),   std::vector<int> v = to_vector(items);
   [&sum](int element) {
      sum += element;
   } );
Building your first Windows Metro style app
  Roadmap for creating Metro style apps
  Tour of the IDE
• XAML designer
  C++ Reference for Windows Runtime
  Windows Runtime Components in C++
  Asynchronous Programming in C++ Using PPL
(Since 10th of January 2012)



                                    http://BeCPP.org/

  Aim?                         quarterly meetings
  Audience?                    free for everyone
  Where?                       At Microsoft offices in Zaventem or at sponsor company
                               locations (we’re still looking for hosts / sponsors!)
  Announcements?               subscribe to our blog to stay up-to-date
  Questions?                   BeCPP@BeCPP.org
                               or visit the TechDays MEET Corner during breaks
MICROSOFTC++




                                                 2012
PARTICIPATE IN C++
                                     MICROSOFT
                                     DEVELOPER
                                     DIVISION
DEVELOPMENT USER                     DESIGN
                                     RESEARCH
RESEARCH
        SIGN UP ONLINE AT
        http://bit.ly/cppdeveloper
http://aka.ms/mbl-win8




                   http://aka.ms/mbl-win8/build
                             http://aka.ms/mbl-win8/devprev
                                         http://aka.ms/mbl-win8/store
Using the Windows 8 Runtime from C++
Using the Windows 8 Runtime from C++

Contenu connexe

Tendances

More on Classes and Objects
More on Classes and ObjectsMore on Classes and Objects
More on Classes and Objects
Payel Guria
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
David Padbury
 
Concurrency, Scalability & Fault-tolerance 2.0 with Akka Actors & STM
Concurrency, Scalability & Fault-tolerance 2.0 with Akka Actors & STMConcurrency, Scalability & Fault-tolerance 2.0 with Akka Actors & STM
Concurrency, Scalability & Fault-tolerance 2.0 with Akka Actors & STM
Mario Fusco
 

Tendances (20)

ECMA 入门
ECMA 入门ECMA 入门
ECMA 入门
 
More on Classes and Objects
More on Classes and ObjectsMore on Classes and Objects
More on Classes and Objects
 
What's New In C# 5.0 - Rumos InsideOut
What's New In C# 5.0 - Rumos InsideOutWhat's New In C# 5.0 - Rumos InsideOut
What's New In C# 5.0 - Rumos InsideOut
 
Sylius and Api Platform The story of integration
Sylius and Api Platform The story of integrationSylius and Api Platform The story of integration
Sylius and Api Platform The story of integration
 
DIWE - Working with MySQL Databases
DIWE - Working with MySQL DatabasesDIWE - Working with MySQL Databases
DIWE - Working with MySQL Databases
 
Constructor,destructors cpp
Constructor,destructors cppConstructor,destructors cpp
Constructor,destructors cpp
 
Powerful JavaScript Tips and Best Practices
Powerful JavaScript Tips and Best PracticesPowerful JavaScript Tips and Best Practices
Powerful JavaScript Tips and Best Practices
 
Domänenspezifische Sprachen mit Xtext
Domänenspezifische Sprachen mit XtextDomänenspezifische Sprachen mit Xtext
Domänenspezifische Sprachen mit Xtext
 
Composite Pattern
Composite PatternComposite Pattern
Composite Pattern
 
Java Script Best Practices
Java Script Best PracticesJava Script Best Practices
Java Script Best Practices
 
RxSwift 활용하기 - Let'Swift 2017
RxSwift 활용하기 - Let'Swift 2017RxSwift 활용하기 - Let'Swift 2017
RxSwift 활용하기 - Let'Swift 2017
 
OOP and FP - Become a Better Programmer
OOP and FP - Become a Better ProgrammerOOP and FP - Become a Better Programmer
OOP and FP - Become a Better Programmer
 
Clean coding-practices
Clean coding-practicesClean coding-practices
Clean coding-practices
 
JavaScript Tutorial
JavaScript  TutorialJavaScript  Tutorial
JavaScript Tutorial
 
JavaScript Programming
JavaScript ProgrammingJavaScript Programming
JavaScript Programming
 
Parte II Objective C
Parte II   Objective CParte II   Objective C
Parte II Objective C
 
SeneJug java_8_prez_122015
SeneJug java_8_prez_122015SeneJug java_8_prez_122015
SeneJug java_8_prez_122015
 
JavaScript Growing Up
JavaScript Growing UpJavaScript Growing Up
JavaScript Growing Up
 
Concurrency, Scalability & Fault-tolerance 2.0 with Akka Actors & STM
Concurrency, Scalability & Fault-tolerance 2.0 with Akka Actors & STMConcurrency, Scalability & Fault-tolerance 2.0 with Akka Actors & STM
Concurrency, Scalability & Fault-tolerance 2.0 with Akka Actors & STM
 
Intro to Javascript
Intro to JavascriptIntro to Javascript
Intro to Javascript
 

En vedette

FORMULARIO CATALOGO ARTISTAS 1 MUSICA
FORMULARIO CATALOGO ARTISTAS 1 MUSICAFORMULARIO CATALOGO ARTISTAS 1 MUSICA
FORMULARIO CATALOGO ARTISTAS 1 MUSICA
Giovany Alvarez
 

En vedette (20)

Ron thomassen-affiliprint
Ron thomassen-affiliprintRon thomassen-affiliprint
Ron thomassen-affiliprint
 
MVVM Applied: From Silverlight to Windows Phone to Windows 8
MVVM Applied: From Silverlight to Windows Phone to Windows 8MVVM Applied: From Silverlight to Windows Phone to Windows 8
MVVM Applied: From Silverlight to Windows Phone to Windows 8
 
Webcasting
WebcastingWebcasting
Webcasting
 
Presentatie Albelli
Presentatie AlbelliPresentatie Albelli
Presentatie Albelli
 
WWV2015: ISM Sam Manus
WWV2015: ISM Sam ManusWWV2015: ISM Sam Manus
WWV2015: ISM Sam Manus
 
Presentatie E-Shop Expo 2014: Voice agency
Presentatie E-Shop Expo 2014: Voice agencyPresentatie E-Shop Expo 2014: Voice agency
Presentatie E-Shop Expo 2014: Voice agency
 
WWV 2015: Marco Coninx Verover Europa
WWV 2015: Marco Coninx Verover EuropaWWV 2015: Marco Coninx Verover Europa
WWV 2015: Marco Coninx Verover Europa
 
E-Shop Expo 2015 DGOC Marc de Groot
E-Shop Expo 2015 DGOC Marc de GrootE-Shop Expo 2015 DGOC Marc de Groot
E-Shop Expo 2015 DGOC Marc de Groot
 
WWV2015: Sam manus-ism
WWV2015: Sam manus-ismWWV2015: Sam manus-ism
WWV2015: Sam manus-ism
 
FORMULARIO CATALOGO ARTISTAS 1 MUSICA
FORMULARIO CATALOGO ARTISTAS 1 MUSICAFORMULARIO CATALOGO ARTISTAS 1 MUSICA
FORMULARIO CATALOGO ARTISTAS 1 MUSICA
 
Presentatie E-Shop Expo 2014: Copernica_19 maart
Presentatie E-Shop Expo 2014: Copernica_19 maartPresentatie E-Shop Expo 2014: Copernica_19 maart
Presentatie E-Shop Expo 2014: Copernica_19 maart
 
Mojoportal
MojoportalMojoportal
Mojoportal
 
E-Shop Expo 2015 Dynalogic Francis Nevens
E-Shop Expo 2015 Dynalogic Francis NevensE-Shop Expo 2015 Dynalogic Francis Nevens
E-Shop Expo 2015 Dynalogic Francis Nevens
 
E-Shop Expo 2015 De Klantenluisteraar Frans Reichardt
E-Shop Expo 2015 De Klantenluisteraar Frans ReichardtE-Shop Expo 2015 De Klantenluisteraar Frans Reichardt
E-Shop Expo 2015 De Klantenluisteraar Frans Reichardt
 
Presentatie E-Shop Expo 2014: ISM_Cedric Beeris
Presentatie E-Shop Expo 2014: ISM_Cedric BeerisPresentatie E-Shop Expo 2014: ISM_Cedric Beeris
Presentatie E-Shop Expo 2014: ISM_Cedric Beeris
 
E-commerce in een wijzigende juridische context
E-commerce in een wijzigende juridische contextE-commerce in een wijzigende juridische context
E-commerce in een wijzigende juridische context
 
Logistiek & E-commerce: NVC
Logistiek & E-commerce: NVCLogistiek & E-commerce: NVC
Logistiek & E-commerce: NVC
 
WWV2015: Remco Bron_InBeacon_keynote a_22 jan
WWV2015: Remco Bron_InBeacon_keynote a_22 janWWV2015: Remco Bron_InBeacon_keynote a_22 jan
WWV2015: Remco Bron_InBeacon_keynote a_22 jan
 
Presentatie E-Shop Expo: BeCommerce_figures and trends 2014
Presentatie E-Shop Expo: BeCommerce_figures and trends 2014Presentatie E-Shop Expo: BeCommerce_figures and trends 2014
Presentatie E-Shop Expo: BeCommerce_figures and trends 2014
 
Woensdag e expo 2012
Woensdag e expo 2012Woensdag e expo 2012
Woensdag e expo 2012
 

Similaire à Using the Windows 8 Runtime from C++

Distributed Objects: CORBA/Java RMI
Distributed Objects: CORBA/Java RMIDistributed Objects: CORBA/Java RMI
Distributed Objects: CORBA/Java RMI
elliando dias
 

Similaire à Using the Windows 8 Runtime from C++ (20)

Unittests für Dummies
Unittests für DummiesUnittests für Dummies
Unittests für Dummies
 
Day 1
Day 1Day 1
Day 1
 
比XML更好用的Java Annotation
比XML更好用的Java Annotation比XML更好用的Java Annotation
比XML更好用的Java Annotation
 
JavaScript and UI Architecture Best Practices
JavaScript and UI Architecture Best PracticesJavaScript and UI Architecture Best Practices
JavaScript and UI Architecture Best Practices
 
A resource oriented framework using the DI/AOP/REST triangle
A resource oriented framework using the DI/AOP/REST triangleA resource oriented framework using the DI/AOP/REST triangle
A resource oriented framework using the DI/AOP/REST triangle
 
Paradigmas de linguagens de programacao - aula#9
Paradigmas de linguagens de programacao - aula#9Paradigmas de linguagens de programacao - aula#9
Paradigmas de linguagens de programacao - aula#9
 
JavaScript Core
JavaScript CoreJavaScript Core
JavaScript Core
 
PHP: GraphQL consistency through code generation
PHP: GraphQL consistency through code generationPHP: GraphQL consistency through code generation
PHP: GraphQL consistency through code generation
 
Distributed Objects: CORBA/Java RMI
Distributed Objects: CORBA/Java RMIDistributed Objects: CORBA/Java RMI
Distributed Objects: CORBA/Java RMI
 
How I started to love design patterns
How I started to love design patternsHow I started to love design patterns
How I started to love design patterns
 
TypeScript for Java Developers
TypeScript for Java DevelopersTypeScript for Java Developers
TypeScript for Java Developers
 
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09L2 Web App Development Guest Lecture At University of Surrey 20/11/09
L2 Web App Development Guest Lecture At University of Surrey 20/11/09
 
Vaadin 7
Vaadin 7Vaadin 7
Vaadin 7
 
TypeScript Introduction
TypeScript IntroductionTypeScript Introduction
TypeScript Introduction
 
2. Design patterns. part #2
2. Design patterns. part #22. Design patterns. part #2
2. Design patterns. part #2
 
Clean code
Clean codeClean code
Clean code
 
Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)
Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)
Mirror, mirror on the wall: Building a new PHP reflection library (DPC 2016)
 
Ember.js - A JavaScript framework for creating ambitious web applications
Ember.js - A JavaScript framework for creating ambitious web applications  Ember.js - A JavaScript framework for creating ambitious web applications
Ember.js - A JavaScript framework for creating ambitious web applications
 
Php 5.6
Php 5.6Php 5.6
Php 5.6
 
MBL301 Data Persistence to Amazon Dynamodb for Mobile Apps - AWS re: Invent 2012
MBL301 Data Persistence to Amazon Dynamodb for Mobile Apps - AWS re: Invent 2012MBL301 Data Persistence to Amazon Dynamodb for Mobile Apps - AWS re: Invent 2012
MBL301 Data Persistence to Amazon Dynamodb for Mobile Apps - AWS re: Invent 2012
 

Plus de Microsoft Developer Network (MSDN) - Belgium and Luxembourg

Plus de Microsoft Developer Network (MSDN) - Belgium and Luxembourg (20)

Code in the Cloud - Ghent - 20 February 2015
Code in the Cloud - Ghent - 20 February 2015Code in the Cloud - Ghent - 20 February 2015
Code in the Cloud - Ghent - 20 February 2015
 
Executive Summit for ISV & Application builders - January 2015
Executive Summit for ISV & Application builders - January 2015Executive Summit for ISV & Application builders - January 2015
Executive Summit for ISV & Application builders - January 2015
 
Executive Summit for ISV & Application builders - Internet of Things
Executive Summit for ISV & Application builders - Internet of ThingsExecutive Summit for ISV & Application builders - Internet of Things
Executive Summit for ISV & Application builders - Internet of Things
 
Executive Summit for ISV & Application builders - January 2015
Executive Summit for ISV & Application builders - January 2015Executive Summit for ISV & Application builders - January 2015
Executive Summit for ISV & Application builders - January 2015
 
Code in the Cloud - December 8th 2014
Code in the Cloud - December 8th 2014Code in the Cloud - December 8th 2014
Code in the Cloud - December 8th 2014
 
Adam azure presentation
Adam   azure presentationAdam   azure presentation
Adam azure presentation
 
release management
release managementrelease management
release management
 
cloud value for application development
cloud value for application developmentcloud value for application development
cloud value for application development
 
Modern lifecycle management practices
Modern lifecycle management practicesModern lifecycle management practices
Modern lifecycle management practices
 
Belgian visual studio launch 2013
Belgian visual studio launch 2013Belgian visual studio launch 2013
Belgian visual studio launch 2013
 
Windows Azure Virtually Speaking
Windows Azure Virtually SpeakingWindows Azure Virtually Speaking
Windows Azure Virtually Speaking
 
Inside the Microsoft TechDays Belgium Apps
Inside the Microsoft TechDays Belgium AppsInside the Microsoft TechDays Belgium Apps
Inside the Microsoft TechDays Belgium Apps
 
TechDays 2013 Developer Keynote
TechDays 2013 Developer KeynoteTechDays 2013 Developer Keynote
TechDays 2013 Developer Keynote
 
Windows Phone 8 Security Deep Dive
Windows Phone 8 Security Deep DiveWindows Phone 8 Security Deep Dive
Windows Phone 8 Security Deep Dive
 
Deep Dive into Entity Framework 6.0
Deep Dive into Entity Framework 6.0Deep Dive into Entity Framework 6.0
Deep Dive into Entity Framework 6.0
 
Applied MVVM in Windows 8 apps: not your typical MVVM session!
Applied MVVM in Windows 8 apps: not your typical MVVM session!Applied MVVM in Windows 8 apps: not your typical MVVM session!
Applied MVVM in Windows 8 apps: not your typical MVVM session!
 
Building SPA’s (Single Page App) with Backbone.js
Building SPA’s (Single Page App) with Backbone.jsBuilding SPA’s (Single Page App) with Backbone.js
Building SPA’s (Single Page App) with Backbone.js
 
Deep Dive and Best Practices for Windows Azure Storage Services
Deep Dive and Best Practices for Windows Azure Storage ServicesDeep Dive and Best Practices for Windows Azure Storage Services
Deep Dive and Best Practices for Windows Azure Storage Services
 
Building data centric applications for web, desktop and mobile with Entity Fr...
Building data centric applications for web, desktop and mobile with Entity Fr...Building data centric applications for web, desktop and mobile with Entity Fr...
Building data centric applications for web, desktop and mobile with Entity Fr...
 
Bart De Smet Unplugged
Bart De Smet UnpluggedBart De Smet Unplugged
Bart De Smet Unplugged
 

Dernier

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 

Dernier (20)

Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 

Using the Windows 8 Runtime from C++

  • 1.
  • 2.
  • 3.
  • 5.
  • 6. View Metro style Apps Desktop Apps XAML HTML / CSS Controller C C# JavaScript Model HTML C C# C++ VB (Chakra) JavaScrip t C++ VB WinRT APIs System Services Communication Graphics & Devices & & Data Media Printing Application Model Internet .NET Explorer Win32 / SL Core Windows Core OS Services
  • 7. The Sweet Spot for C++… Power, Performance and Portability.
  • 8.
  • 10.
  • 11. Demo
  • 13.
  • 14.
  • 15. 1. Person^ p = nullptr; 2. { 3. Person^ newP = ref new Person(); // refcount = 1 4. newP->Name = “John”; // refcount = 1 5. p = newP; // refcount = 2 6. } // refcount = 1 7. p = nullptr; // refcount = 0; ~Person()
  • 16. Key Bindings Feature Summary 1. Data Types ref class Reference type value class Value type interface class Interface property Property with get/set event “Delegate property” with add/remove/raise delegate Type-safe function pointer generic Type-safe generics 2. Allocation ref new Reference-counted allocation 3. Pointer & ^ Strong pointer (“hat” or “handle”) Reference % Strong reference
  • 17.
  • 19. 1. delegate void CarouselInitDoneHandler(IUIAnimationVariable^ rotation); 2. void CarouselAnimation::Initialize(double angle, CarouselInitDoneHandler^ callback) { 3. // Create Animation Manager 4. using namespace Engine::Graphics; 5. UIAnimationManager animationManager; 6. // Create rotation animation variable 7. IUIAnimationVariable^ rotation = animationManager.CreateAnimationVariable(angle); 8. // Set the event handler for the story board 9. rotation->GetCurrentStoryBoard()->SetStoryBoardEventHandler( 10. ref new CarouselStoryBoardHandler(this, CarouselAnimation::StoryBoard) 11. ); 12. // Invoke the callback when done 13. callback(rotation); 14. }
  • 20. public ref class Person { public: Person(String^ name, String^ email); void Greet(Person^ other); internal: ~Person(); void SetPassword(const std::wstring& passwd); }; Person^ p = ref new Person(“John Surname”); p->Greet(ref new Person(“Jim Surname”);
  • 21. public interface class IAnimal { public interface class IFeline : void Play(); IAnimal { }; void Scratch(); }; IAnimal^ animal = ref new Cat(); ref class Cat : IFeline { animal->Play(); public: virtual void Play(); virtual void Scratch(); };
  • 22. public ref class DatabaseConnection { public: ~ DatabaseConnection(); }; { DatabaseConnection db(); db.SetName( “Employees”); // … // … lots of queries, updates, etc. … // … } // ~DatabaseConnection()
  • 23. public: property String^ Name; public: property Person^ Sibling { Person^ get() { InitSiblings(); return _sibling; } void set(Person^ value) { _sibling = value; NotifySibling(); } } private: Person^ _sibling; Person^ p = ref new Person(“John”); p->Sibling = ref new Person(p->Name);
  • 24. public delegate void PropertyChanged( String^ propName, String^ propValue ); auto p = ref new PropertyChanged( [](String^ pn, String^ pv) { cout << pn << ” = “ << pv; } ); auto p = ref new PropertyChanged( UIPropertyChanged ); auto p = ref new PropertyChanged( this, MainPage::OnPropertyChanged ); p( “Visible”, false );
  • 25. public: event PropertyChanged^ OnPropertyChanged; public: event PropertyChanged^ OnNetworkChanged { EventRegistrationToken add(PropertyChanged^); void remove(EventRegistrationToken t); void raise(String^, String^); } person->OnPropertyChanged += propertyChangedDelegate; auto token = person->OnPropertyChanged::add(propertyChangedDelegate); person->OnPropertyChanged -= token; person->OnPropertyChanged::remove(token);
  • 26. HRESULT Exception E_OUTOFMEMORY OutOfMemoryException E_INVALIDARG InvalidArgumentException E_NOINTERFACE InvalidCastException E_POINTER NullReferenceException E_NOTIMPL NotImplementedException E_ACCESSDENIED AccessDeniedException throw ref new InvalidArgumentException(); E_FAIL FailureException throw ref new COMException(E_*); E_BOUNDS OutOfBoundsException E_CHANGED_STATE ChangedStateException REGDB_E_CLASSNOTREG ClassNotRegisteredException try { … } catch (OutOfMemoryException^ ex) E_DISCONNECTED { … } E_ABORT DisconnectedException OperationCanceledException ex->HResult • catch (Platform::Exception^)
  • 27. generic<typename T, typename U> ref class PairStringUri: public interface class IPair { IPair<String^, Uri^> { property T First; public: property U Second; property String^ First; }; property Uri^ Second; }; IPair<String^, Uri^>^ uri = GetUri(); auto first = uri->First; // type is String^ auto second = uri->Second; // type is Uri^
  • 28. template<typename T, typename U> ref class Pair: IPair<T, U> { public: property T First; property U Second; Pair(T first, U second) { First = first; Second = second; } }; IPair<String^, Uri^>^ pair = ref new Pair<String^, Uri^>( “//BUILD/”, ref new Uri(“http://www.buildwindows.com”));
  • 30. private partial ref class MainPage: UserControl, IComponentConnector { public: void InitializeComponent(); void Connect() { btn1->Click += ref new EventHandler(this, &MainPage::Button_Click); } }; ref class MainPage { public: MainPage() { InitializeComponent(); } void Button_Click(Object^ sender, RoutedEventArgs^ e); };
  • 32. using namespace Platform; Vector<String^>^ items = ref new Vector<String^>(); items->Append(“Hello”); • Returning a read-only view of the vector IVectorView<String^>^ GetItems () { return items->GetView(); } items->VectorChanged += ref new VectorChangedEventHandler<String^> (this, &MyClass::VectorChanged);
  • 33. using namespace Platform; Map<String^, Uri^> favorites = ref new Map<String^, Uri^>(); favorites->Insert(“MSDN”, ref new Uri(“http://msdn.com”)); if (favorites->HasKey(“MSDN”)) favorites->Remove(“MSDN”);
  • 34. Begin()/End() std::vector<int> v; begin() end() v.push_back(10); auto items = ref new Vector<int>(v); IVector<int>^ v = GetItems(); int sum = 0; Vector<int>^ items = …; std::for_each( begin(v), end(v), std::vector<int> v = to_vector(items); [&sum](int element) { sum += element; } );
  • 35.
  • 36. Building your first Windows Metro style app Roadmap for creating Metro style apps Tour of the IDE • XAML designer C++ Reference for Windows Runtime Windows Runtime Components in C++ Asynchronous Programming in C++ Using PPL
  • 37. (Since 10th of January 2012) http://BeCPP.org/ Aim? quarterly meetings Audience? free for everyone Where? At Microsoft offices in Zaventem or at sponsor company locations (we’re still looking for hosts / sponsors!) Announcements? subscribe to our blog to stay up-to-date Questions? BeCPP@BeCPP.org or visit the TechDays MEET Corner during breaks
  • 38. MICROSOFTC++ 2012 PARTICIPATE IN C++ MICROSOFT DEVELOPER DIVISION DEVELOPMENT USER DESIGN RESEARCH RESEARCH SIGN UP ONLINE AT http://bit.ly/cppdeveloper
  • 39. http://aka.ms/mbl-win8 http://aka.ms/mbl-win8/build http://aka.ms/mbl-win8/devprev http://aka.ms/mbl-win8/store

Notes de l'éditeur

  1. PDC-3