Presentation is loading. Please wait.

Presentation is loading. Please wait.

Exploiting WinFX from Win32/MFC Applications

Similar presentations


Presentation on theme: "Exploiting WinFX from Win32/MFC Applications"— Presentation transcript:

1 Exploiting WinFX from Win32/MFC Applications
4/10/2019 3:58 PM Session Code: CLI-390 Exploiting WinFX from Win32/MFC Applications Anson Tsao Lead Program Manager Microsoft Corporation © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

2 Internet Connection Firewall
4/10/2019 3:58 PM Presentation Data Communication Communication Avalon Avalon Windows Forms Windows Forms ASP.NET WinFS WinFS ADO.NET Indigo Indigo Collaboration Document UI Media Object T/SQL XML Service Models Services Schemas Desktop Window Manager Controls Interop Engine Connectivity Messaging Services Desktop Services Adaptive UI Engine People Group ObjectSpaces People and Groups Synchronization (WinFS, Win32..) Channels (Datagram, Reliable, Peer, …) Policy Engine Page/Site Composition Calendar Media Queuing Eventing Routing Presentation Object Manager Desktop Composition Engine Application Services Document DataSet Channel Security Collaboration History Media Services InfoAgent (PreferenceRules..) Data Model Transport Channels (IPC, HTTP, TCP…) Animation and Composition Media Processing Capture and Sourcing Designer Services Personalization and Profiling Services Items SQL XML Message Encoder Real-Time Activities System Services FileSystem Services (MetaDataHandlers..) Relationships Providers Communications Manager (Port) Transaction Signaling Framework Hardware Rendering Software Rendering and Sinks Controls Membership and Security Services Extensions Federation Base Operating System Services CLR Base Class Libraries Network Class Library Application Deployment Engine (Click-Once) Memory Manager Code Execution Loader Security Serialization Hosting Layer Network Services Demand Activation and Protocol Health GDI/GDI+ Window Manager Global Audio Engine Direct 3D Graphics Transactions Identity & Security System Storage PNRP Native WiFi SIP Management Services (Event Logs, Tracing, Probes, Auto Update, Admin) TCP Listener UDP Listener IPC Listener Graphics drivers Lightweight Transactions Transaction Coordinator Virtual Shadow Copy Service File Replication Service Virtual Disk Service Internet Connection Firewall DDI Input Manager Audio Drivers DirectX Graphics Mini port Kernel Transaction Manager Logging Service Redirectors Distributed File System Filter Manager Cache Manager Protocols Filter Engine TCP, UDP IPV4, IPV6 IPSEC QOS HTTP Listener Plug and Play Memory Manager Power Manager Config Manager Process Manager Security Reference Monitor LPC Facility Transacted NTFS Universal Data Format FAT 16/32 IO Manager Device Drivers Kernel SCSI/FC 802.3 802.11 .. Kernel Mode Hardware Abstraction Layer © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

3 Agenda Roadmap: Win32 to “Longhorn” WinFX C++ for .NET and WinFX
4/10/2019 3:58 PM Agenda Roadmap: Win32 to “Longhorn” WinFX C++ for .NET and WinFX Using WinFX in Existing Applications Summary © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

4 4/10/2019 3:58 PM Visual C++ Goals Enable early and broad adoption of .NET and Longhorn features Realistic migration path – no discontinuity Leverage existing code in Longhorn Apps Rewrite is optional C++ as a first class language for .NET and WinFX development C++/CLI core to language not an extension Bring C++ Idioms to .NET Seamless transitions between native and CLR development © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

5 4/10/2019 3:58 PM Win32 To WinFX Roadmap Run in Partial Trust? In Maintenance Mode? Refresh No Update the native application, ‘Good citizen’ on Longhorn Yes Least Investment No Yes Keep Existing App Model? Integrate Add Longhorn features to the existing application Yes No Migrate Reuse existing code in a new Avalon application model Rewrite Rewrite as verifiable application using WinFx only Most Investment © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

6 Refresh Win32 apps work better under Longhorn! Advantages
4/10/2019 3:58 PM Refresh Win32 apps work better under Longhorn! ‘Good Citizen’ on Windows Signed Application Manifest Transparent use of WinFS Volumes WinFS ‘aware’ file types – promotion/demotion CLI :00pm – Enhancements for a trustworthy application experience Advantages Minimal work Compatible with down-level platforms Disadvantages Does not fully leverage Longhorn features © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

7 4/10/2019 3:58 PM Integrate Tight integration of WinFX API into Win32 application using C++ Add and Replace with Longhorn Features Advantages Fully leverage existing code base Full access to Longhorn APIs Augment existing UI with Avalon Retains existing performance characteristics Disadvantages Does not take advantage of new Longhorn application and deployment models Consider CLR-based extensibility/plug-in model © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

8 Using WinFX In Existing C++ Application
4/10/2019 3:58 PM Using WinFX In Existing C++ Application Anson Tsao Lead Program Manager Visual C++ © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

9 4/10/2019 3:58 PM Migrate Componentize existing code for new Avalon UI and Application Model Wrapping existing code with managed object model Advantages CLS compliant object model Leverage new Longhorn User Interface Reuse core logic Write new code with CLR types only Disadvantages Binary image not verifiable or 32/64 bit compat. © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

10 Rewrite Advantages Disadvantages Rewrite using WinFX APIs only
4/10/2019 3:58 PM Rewrite Rewrite using WinFX APIs only Advantages New Longhorn Application Models Verifiable - New Deployment options, Secure Execution Environment Architecture Independent – 32/64 bit compatible Binary Disadvantages Programming model learning curve Not deployable to downlevel OS Rewrite domain specific code © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

11 Write New LH Application
4/10/2019 3:58 PM Write New LH Application Built on top of new Longhorn services Advantages New Longhorn Application Models Verifiable - New Deployment options, Secure Execution Environment Architecture Independent – 32/64 bit compatible Binary Disadvantages Programming model learning curve Not deployable to downlevel OS Rewrite domain specific code © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

12 Agenda Roadmap: Win32 to “Longhorn” WinFX C++ for .NET and WinFX
4/10/2019 3:58 PM Agenda Roadmap: Win32 to “Longhorn” WinFX C++ for .NET and WinFX Using WinFX in Existing Applications Summary © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

13 Compile with /CLR New Compiler Options:
4/10/2019 3:58 PM Compile with /CLR New Compiler Options: CLS Compliance checking Compile as Pure MSIL /CLR:Pure Compile as Verifiable MSIL /CLR:Safe Direct Access to .NET and WinFX Compile almost anything into MSIL Control with Mixed Mode PE Image Unified C++ Language Using ISO C++ and C++/CLI Together © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

14 ISO C++ and C++/CLI Together
4/10/2019 3:58 PM ISO C++ and C++/CLI Together Standard C++ Types CLR Type from WinFX C++ Smart Pointers Templates & Deterministic Finalization Data Marshalling Library .NET Idiom © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

15 ISO C++ and C++/CLI Together
4/10/2019 3:58 PM ISO C++ and C++/CLI Together © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

16 Impedance Mismatch Object Lifetimes Data Marshalling
4/10/2019 3:58 PM Impedance Mismatch Object Lifetimes Garbage Collector vs. Explicit Cleanup Callbacks, events and delegates Data Marshalling Data type conversions Application Domain Scope of static and global variables COM Apartments and App Domains (ARC310) Native code to MSIL transitions © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

17 Mixed Mode vs. Pure Mixed Mode – For Integration Pure - For Migration
4/10/2019 3:58 PM Mixed Mode vs. Pure Mixed Mode – For Integration Advanced Optimizations: e.g. WPO, floating point etc. CPU specific instructions: e.g. MMX, SSE/SSE2 Process-wide globals/statics Native Entry Points Pure - For Migration AppDomain Aware Some perf wins – CLR only calling convention Reflection on EXE Click-once © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

18 /CLR vs. CLR Hosting /CLR – Recommended CLR Host – Specialized
4/10/2019 3:58 PM /CLR vs. CLR Hosting /CLR – Recommended General CLR integration Full language support Seamless access to WinFX CLR Host – Specialized Control Default Application Domain Control CLR resource usage Example: Yukon © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

19 C++ vs. CLR Interop C++ Interop – Recommended
4/10/2019 3:58 PM C++ vs. CLR Interop C++ Interop – Recommended Language and Library support Typesafe - #include, MIDL Built on CLR facilities – e.g. P/Invoke User controlled marshalling Need to understand AppDomain, COM Apartments CLR Interop – All other .NET Languages DllImport (P/Invoke) - redefinition COM Interop – redefinition CCW - extra transition Also available to C++ © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

20 Agenda Roadmap: Win32 to “Longhorn” WinFX C++ for .NET and WinFX
4/10/2019 3:58 PM Agenda Roadmap: Win32 to “Longhorn” WinFX C++ for .NET and WinFX Using WinFX in Existing Applications Summary © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

21 Integrating Avalon In Existing User Interface
4/10/2019 3:58 PM Integrating Avalon In Existing User Interface Anson Tsao Lead Program Manager Visual C++ © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

22 Avalon/HWND integration
4/10/2019 3:58 PM Avalon/HWND integration HwndSource XAML in HWND HwndHost HWND in XAML HwndVisual Avalon Visual in HWND © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

23 Extend with WinFX Example: Augment UI with Avalon
4/10/2019 3:58 PM Extend with WinFX Example: Augment UI with Avalon Win32/MFC Hosting Avalon Avalon hosting Win32/MFC/ActiveX Avalon Visual for Rendering Example: Storage with WinFS Expose Document Metadata Replace proprietary metadata store Access to Shared Data Online/Offline with caching and synchronization Example: Communications with Indigo © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

24 MFC – Whidbey and beyond
4/10/2019 3:58 PM MFC – Whidbey and beyond Focused on Reliability and Interoperability with .NET and WinFX Whidbey – WinForms Integration WinForms as Modal and Modeless Dialogs WinForms Controls/Forms as Child Windows WinForms Forms as CView, with command routing Avalon Integration © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

25 Agenda Roadmap: Win32 to “Longhorn” WinFX C++ for .NET and WinFX
4/10/2019 3:58 PM Agenda Roadmap: Win32 to “Longhorn” WinFX C++ for .NET and WinFX Using WinFX in Existing Applications Summary © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

26 Summary Integrate with Longhorn C++ Applications are Future Proof
4/10/2019 3:58 PM Summary Integrate with Longhorn Use WinFX everywhere! C++ Applications are Future Proof Write entirely new Longhorn Applications Leverage existing code base Extend existing application with WinFX Incorporate Whidbey .NET Framework now Whidbey C++ is first step Language and library will make WinFX roadmap even better © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

27 For More Information Further Resources Other PDC Resources
4/10/2019 3:58 PM For More Information Further Resources Other PDC Resources C++ hands on labs Ask the Experts Visual C++ Product Booth Panel: Future of .NET Languages Newsgroup microsoft.public.vc.* microsoft.public.dotnet.languages.vc.* © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

28 4/10/2019 3:58 PM Related Sessions TLS 310: Visual C++ “Whidbey”: New Language Design and Enhancements TLS 401: Visual C++ Whidbey Under the Covers: Targeting the CLR TLS 311: Visual C++ Whidbey: Leveraging Native Code with .NET ARC 310: Interop Best Practices and Common Pitfalls © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.

29 © 2003-2004 Microsoft Corporation. All rights reserved.
4/10/2019 3:58 PM © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary. © Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.


Download ppt "Exploiting WinFX from Win32/MFC Applications"

Similar presentations


Ads by Google