Book description
Foundations of C++/CLI: The Visual C++ Language for .NET 3.5 introduces C++/CLI, Microsoft's extensions to the C++ syntax that allow you to target the common language runtime, the key to the heart of the .NET Framework 3.5. This book gives you a small, fast-paced primer that will kick-start your journey into the world of C++/CLI. In 13 no–fluff chapters, Microsoft insiders take readers into the core of the C++/CLI language and explain both how the language elements work and how Microsoft intends them to be used.
This book is a beginner's guide, but it assumes a familiarity with programming basics. And it concentrates on explaining the aspects of C++/CLI that make it the most powerful and fun language of the .NET Framework. As such, this book is ideal if you're thinking of migrating to C++/CLI from another language. By the end of this book, you'll have a thorough grounding in the core language elements together with the confidence to explore further that comes from a solid understanding of a language's syntax and grammar.
What you'll learn
The basics of C++/CLI
The object–oriented features of C++/CLI
How C++/CLI sits within the .NET Framework 3.5
How to create C++/CLI programs
Using STL/CLR
Who this book is for
Developers wanting to learn C++/CLI.
Table of contents
- Title Page
- Dedication
- Contents at a Glance
- Contents
- Foreword by Brandon Bray
- Foreword to the First Edition by Stanley B. Lippman
- Foreword by Herb Sutter
- About the Author
- About the Technical Reviewer
- Acknowledgments
- Introduction
- CHAPTER 1 Introducing C++/CLI
- CHAPTER 2 A Quick Tour of the C++/CLI Language Features
-
CHAPTER 3 Building C++/CLI Programs for the Common Language Runtime with Visual C++
- Targeting the CLR with Visual C++
- Visual C++ Compilation Modes
- Caveats When Upgrading Code to Visual C++ 2005 or 2008
- Architecture Dependence and 64-bit Programming
- Assemblies and Modules
- The Assembly Manifest
- The #using Directive
- Referencing Assemblies and Access Control
- Friend Assemblies
- Assembly Attributes
- The Linker and the Assembly Linker
- Resources and Assemblies
- Signed Assemblies
- Multifile Assemblies
- C++/CLI in the Visual Studio Development Environment
- Summary
-
CHAPTER 4 Object Semantics in C++/CLI
- Object Semantics for Reference Types
- Object Semantics for Value Types
- Implications of the Unified Type System
- Implicit Boxing and Unboxing
- Stack vs. Heap Semantics
- The Unary % Operator and Tracking References
- Dereferencing Handles
- Copy Constructors
- Lvalues, GC-Lvalues, Rvalues, and GC-Rvalues
- auto_handle
- Parameter Passing
- Summary of Parameter-Passing Semantics
- Do's and Don'ts of Returning Values
- Summary
- CHAPTER 5 Fundamental Types: Strings, Arrays, and Enums
-
CHAPTER 6 Classes and Structs
- Constructors and Initialization
- Static Constructors
- Copy Constructors for Reference and Value Types
- Literal Fields
- initonly Fields
- Const Correctness
- Properties, Events, and Operators
- Example: A Scrabble Game
- The this Pointer
- Access Levels for Classes
- Native and Managed Classes
- Class Destruction and Cleanup
- Finalizers
- Summary
- CHAPTER 7 Features of a .NET Class
- CHAPTER 8 Inheritance
-
CHAPTER 9 Interfaces
- Interfaces vs. Abstract Classes
- Declaring Interfaces
- Interfaces Implementing Other Interfaces
- Interfaces with Properties and Events
- Interface Name Collisions
- Interfaces and Access Control
- Interfaces and Static Members
- Literals in Interfaces
- Commonly Used .NET Framework Interfaces
- Interfaces and Dynamically Loaded Types
- Summary
- CHAPTER 10 Exceptions, Attributes, and Reflection
- CHAPTER 11 Parameterized Functions and Types
-
CHAPTER 12 An Introduction to the STL/CLR Library
- A First Look at the STL/CLR Library
- STL and STL/CLR Basic Ideas
- STL/CLR Terminology and Naming Conventions
- STL/CLR Container Types
- Value Types and Reference Types in an STL/CLR Container
- STL/CLR Iterators
- STL/CLR Algorithms
- The STL/CLR deque Type
- Other STL/CLR Containers
- Anatomy of a Vector
- Using STL/CLR Across Assembly Boundaries
- STL/CLR Function Objects and Delegates
- Working with STL/CLR Containers and .NET Collections
- Summary
-
CHAPTER 13 Interoperability
- The Many Faces of Interop
- Interoperating with Other .NET Languages
- Using Native Libraries with Platform Invoke
- The Marshaling Library
- Using Native Libraries Without P/Invoke
- Recompiling a Native Library As Managed Code
- Interop with COM
- Interior Pointers
- Pinning Pointers
- Native Objects and Managed Objects
- Native and Managed Entry Points
- Managed and Native Exceptions
- Summary
- APPENDIX Quick Reference
- Index
Product information
- Title: Foundations of C++/CLI: The Visual C++ Language for .NET 3.5
- Author(s):
- Release date: August 2008
- Publisher(s): Apress
- ISBN: 9781430210238
You might also like
book
C++ 2013 for C# Developers,Second Edition
" C++ 2013 for C# Developers provides a fast-track to C++ proficiency forthose already using the …
book
Ivor Horton's Beginning Visual C++ 2013
Learn C++ with the best tutorial on the market! Horton's unique tutorial approach and step-by-step guidance …
book
Windows 8 MVVM Patterns Revealed: covers both C# and JavaScript
The Model-View-View-Model (MVVM) pattern is held in high regard by many developers as an excellent way …
book
Microsoft Visual C++ Windows Applications by Example
In Detail With this book you will learn how to create applications using MDI, complex file …