Book description
C++/CLI in Action is a practical guide that will help you breathe new life into your legacy C++ programs. The book begins with a concise C++/CLI tutorial. It then quickly moves to the key themes of native/managed code interop and mixed-mode programming. You'll learn to take advantage of GUI frameworks like Windows Forms and WPF while keeping your native C++ business logic. The book also covers methods for accessing C# or VB.NET components and libraries.
Table of contents
- preface
- acknowledgments
- about this book
-
Part 1 - The C++/CLI Language
-
Introduction to C++/CLI
- 1.1 The role of C++/CLI (1/2)
- 1.1 The role of C++/CLI (2/2)
- 1.2 Hello World in C++/CLI
- 1.3 Declaring CLR types (1/2)
- 1.3 Declaring CLR types (2/2)
- 1.4 Handles: the CLI equivalent to pointers
- 1.5 Instantiating CLI classes (1/2)
- 1.5 Instantiating CLI classes (2/2)
- 1.6 Boxing and unboxing (1/2)
- 1.6 Boxing and unboxing (2/2)
- 1.7 Summary
-
Getting into the CLI: properties, delegates and arrays
- 2.1 Properties (1/3)
- 2.1 Properties (2/3)
- 2.1 Properties (3/3)
- 2.2 Delegates and events (1/2)
- 2.2 Delegates and events (2/2)
- 2.3 CLI Arrays (1/4)
- 2.3 CLI Arrays (2/4)
- 2.3 CLI Arrays (3/4)
-
2.3 CLI Arrays (4/4)
- 2.3.1 Basic CLI array concepts
- 2.3.2 Single-dimensional arrays
- 2.3.3 Multidimensional arrays
- 2.3.4 Jagged arrays
- 2.3.5 Arrays as function arguments
- 2.3.6 Returning arrays from functions
- 2.3.7 Parameter arrays
- 2.3.8 Using System::Array methods
- 2.3.9 Array covariance
- 2.3.10 Arrays of non-CLI objects
- 2.3.11 Directly accessing CLI arrays using native pointers
- 2.4 Summary
-
More C++/CLI: stack semantics, function overriding, and generic programming
- 3.1 Stack semantics and deterministic destruction (1/3)
- 3.1 Stack semantics and deterministic destruction (2/3)
- 3.1 Stack semantics and deterministic destruction (3/3)
- 3.2 Function overriding (1/2)
- 3.2 Function overriding (2/2)
- 3.3 Generics and managed templates (1/5)
- 3.3 Generics and managed templates (2/5)
- 3.3 Generics and managed templates (3/5)
- 3.3 Generics and managed templates (4/5)
- 3.3 Generics and managed templates (5/5)
- 3.4 Summary
-
Introduction to C++/CLI
-
Part 2 - Mixing managed and native code
-
Introduction to mixed-mode programming
- 4.1 Using interior and pinning pointers (1/3)
- 4.1 Using interior and pinning pointers (2/3)
- 4.1 Using interior and pinning pointers (3/3)
- 4.2 Working with interop mechanisms (1/3)
- 4.2 Working with interop mechanisms (2/3)
- 4.2 Working with interop mechanisms (3/3)
- 4.3 Using mixed types (1/3)
- 4.3 Using mixed types (2/3)
- 4.3 Using mixed types (3/3)
- 4.4 Function pointers and delegates: bridging the gap
- 4.5 Summary
-
Interoping with native libraries from managed applications
- 5.1 Converting between managed and native types
- 5.2 Double thunking in mixed-mode function calls
- 5.3 Wrapping a native API and exposing a CLI interface (1/4)
- 5.3 Wrapping a native API and exposing a CLI interface (2/4)
- 5.3 Wrapping a native API and exposing a CLI interface (3/4)
- 5.3 Wrapping a native API and exposing a CLI interface (4/4)
- 5.4 Exposing an MFC extension DLL to .NET (1/2)
- 5.4 Exposing an MFC extension DLL to .NET (2/2)
- 5.5 Accessing a COM object via a custom RCW (1/2)
- 5.5 Accessing a COM object via a custom RCW (2/2)
- 5.6 Writing a single mixed-mode DLL for both managed and native clients (1/2)
- 5.6 Writing a single mixed-mode DLL for both managed and native clients (2/2)
- 5.7 Summary
-
Introduction to mixed-mode programming
-
Part 3 - Using managed frameworks from native applications
-
Interoping Windows Forms with MFC
- 6.1 A simple Windows Forms application
- 6.2 Hosting a Windows Forms control in an MFC dialog
- 6.3 Hosting a Windows Forms control as an MFC view (1/2)
- 6.3 Hosting a Windows Forms control as an MFC view (2/2)
- 6.4 Giving your MFC apps an Office 2003 style UI (1/3)
- 6.4 Giving your MFC apps an Office 2003 style UI (2/3)
- 6.4 Giving your MFC apps an Office 2003 style UI (3/3)
- 6.5 Using a Windows Forms control as an MFC dialog (1/2)
- 6.5 Using a Windows Forms control as an MFC dialog (2/2)
- 6.6 Using an MFC control in a Windows Forms form (1/2)
- 6.6 Using an MFC control in a Windows Forms form (2/2)
- 6.7 Summary
-
Using C++/CLI to target Windows Presentation Foundation applications
- 7.1 What is WPF? (1/2)
- 7.1 What is WPF? (2/2)
- 7.2 Using C++/CLI to write a WPF application (1/3)
- 7.2 Using C++/CLI to write a WPF application (2/3)
- 7.2 Using C++/CLI to write a WPF application (3/3)
- 7.3 A brief look at some WPF Graphics features (1/2)
- 7.3 A brief look at some WPF Graphics features (2/2)
- 7.4 Hosting a WPF control in a native C++ application (1/4)
- 7.4 Hosting a WPF control in a native C++ application (2/4)
- 7.4 Hosting a WPF control in a native C++ application (3/4)
- 7.4 Hosting a WPF control in a native C++ application (4/4)
- 7.5 Hosting a native control in a WPF application
- 7.6 Summary
-
Accessing the Windows Communication Foundation with C++/CLI
- 8.1 Hello World with the Windows Communication Foundation
- 8.2 Duplex communication in WCF (1/2)
- 8.2 Duplex communication in WCF (2/2)
- 8.3 Migrating a native DCOM application to WCF (1/4)
- 8.3 Migrating a native DCOM application to WCF (2/4)
- 8.3 Migrating a native DCOM application to WCF (3/4)
- 8.3 Migrating a native DCOM application to WCF (4/4)
- 8.4 Hosting a WCF service in an IIS server
- 8.5 Summary
- Appendix: A concise introduction to the .NET Framework
-
Interoping Windows Forms with MFC
- index
Product information
- Title: C++/CLI in Action
- Author(s):
- Release date: April 2007
- Publisher(s): Manning Publications
- ISBN: 9781932394818
You might also like
book
WebAssembly: The Definitive Guide
WebAssembly: The Definitive Guide is a thorough and accessible introduction to one of the most transformative …
book
PowerShell Cookbook, 4th Edition
How do you use PowerShell to navigate the filesystem, manage files and folders, or retrieve a …
book
Fluent C
Expert advice on C programming is hard to find. While much help is available for object-oriented …
book
Boost.Asio C++ Network Programming Cookbook
Over 25 hands-on recipes to create robust and highly-efficient cross-platform distributed applications with the Boost.Asio libraryAbout …