Description
Pro Visual C++ 2005 for C# Developers features two distinct sections that lead to a simple migration path for you to move toward Visual C++ 2005 development. If you're an experienced developer approaching Visual C++ from a C# background with .NET 1.1 or 1.0, you'll greatly benefit from this book. The first section introduces the Visual C++ 2005 technology, then outlines the language in fast-track chapters. This overview focuses on the mechanics of the language, without introducing any coding. Additional chapters cover the techniques and issues involved when converting C# applications to Visual C++ 2005.The next portion of the book functions as a detailed reference to Visual C++ 2005 providing information and advice about the technology and its coding techniques. Here you can dip into it as necessary for assistance with your work. This material supplements the information that is already freely available within Visual Studio .NET 2005. With its thorough regard for Visual C++ 2005, this book will earn a place on your shelf as a helpful reference for years to come.
CONTENTS:
PART 1 - Fast Track to C++/CLI
CHAPTER 1 Hello, World
Starting the Visual Studio 2005 Console
Retrieving the Source Files
Executing HelloCpp
A Quick Tour of the Visual C++ IDE
Understanding Projects and Solutions
Understanding the Differences
Window Layout
Building, Executing, and Debugging
Summary
CHAPTER 2 There's No Place Like Home
Developing the Program
Deal Me In
The Completed C# Program
A Quick Look at the Code
Projects and Solutions
A Quick Look
Building and Executing the Project
Binding C++
Doing the Shuffle Without the IDE
Basic Command-Line Compilation
Using a Module
Summary
CHAPTER 3 Syntax
C# class (Reference Type)
C# struct (Value Type)
Caveat
Lack of Locality
The C++ Approach
Types of Member Access Operators
Keyword Differences
Arrays and Functions
The Conversion Operators
Memory Allocation
Accessibility and Visibility
Properties, Events, and Delegates
Generics
Built-in Types
Summary
CHAPTER 4 C# to C++/CLI
Add the Keyword namespace After using
Add the Punctuator ^ to the Reference Type Declarations
Modify the Built-in Types
Change the Array Declarations and Type Parameters
Change the Enumeration Declarations
Change the Object Allocations and Instantiations
Change the Pass by Reference Parameters
Change the Class Member Access Operators for Handles
Change the Separators for Namespaces and Static Accesses
Change the Class Declarations
Add the Function main()
Summary
CHAPTER 5 Tools
Lutz Roeder's .NET Reflector
What Is Reflection?
Lutz Roeder's .NET Reflector
Installing and Loading .NET Reflector and the C++/CLI Add-in
Executing .NET Reflector
Instant C++
Tools Shipped with Visual Studio
Microsoft .NET Framework IL Disassembler (ILDasm)
Dependency Walker (Depends)
More Visual Studio Tools
Summary
CHAPTER 6 Data Types
C# Types vs. C++ Types
The C++ struct Keyword
Native Classes
Value Types and Reference Types
Dynamic Memory Pools
Garbage Collection
Initialization
Boxing
Constructor Forwarding
C# Partial Classes
Reference Types on the Stack
Basic Types
Basic Type Differences
Missing Keywords
Marshaling Required
Summary
CHAPTER 7 Arrays
Native Arrays
Managed Arrays
Managed Array Details
A Simple Example
Arrays as Parameters and Return Values
Sophisticated Example
Higher Dimensional Arrays
Native Arrays
Summary
CHAPTER 8 Polymorphism and Protection
Polymorphism
Inheritance
Interfaces
Abstract Classes
Sealed Classes
Static Classes
Methods
Virtual Methods
Working with Methods
Virtual Methods Summary
Accessing Base Class Fields and Methods
Protection Mechanisms
Visibility
Accessibility
Inheritance
Declaring ref struct and ref class
Overload Resolution
Hide by Name and Hide by Signature
Summary
PART 2 - Details
CHAPTER 9 Pointers and Unsafe Code
The C# View: A Blessing and a Curse
Pointers: A Definition and a Caveat
Valid Targets and Syntax
Common Pointer Operators
Example of Pointer Usage
Verifiable Code and Pointer Usage in C#
Side Effects of Writing Unsafe Code
Pointer Usage in C++
Verifiable Code in C++
C++ Handles
C++/CLI Address Operators
Complex Examples
Nightmares
Summary
CHAPTER 10 Properties and Events
A Basic Example Using Properties in C#
A Basic Example Using Properties in C++/CLI
A Look Inside the Grammar
Trivial Properties
Indexed Properties
C# Properties
Advanced Properties of Properties
Property Caveats
Miscellaneous Property Details
Events and Delegates
Delegates
Multicast Delegates
Instance Delegates
Events
Summary
CHAPTER 11 Expressions and Operators
Operator Overloading
Complex Numbers, a Basic Example
A Mathematical Diversion: Numbers Modulo Primes
Implicit and Explicit Conversions of Built-in Types
User-Defined Conversions
CLS-Compliant Operators
Summary
CHAPTER 12 The End of the Beginning
Include Files
Forward Declarations
The Problem
The Solution
Include File Caveats
Types of Declarations
Scope Resolution Operator
Nullable Types
Examples in C# and C++/CLI
The ?? Operator in C#
Under the Hood
Checked Expressions
Anonymous Methods
Context-Sensitive Keywords
Method Group Conversion
Constructor-Initialized Variables
Expression Statements with No Effect
Exceptions
Basic Exception Handling
Function-Try Blocks
Summary
CHAPTER 13 Fun, Fun, and More Fun
Dropping Light Bulbs
Initial Thoughts
A Rough Approximation
A Little Algebra
Discovering a Recursive Algorithm
Implementation
First Drop
Bridge Crossing
Background
Algorithm and Implementation
The Code
Taking the Algorithm for a Spin
Dealing with Cannibals
Assumptions
The Code
Summary
PART 3 - Advanced Concepts
CHAPTER 14 Generics
A Queue of Tasks
C# Implementation Under .NET 1.0
Moving to Generics
Creating Generic Classes in C++/CLI
Summary
CHAPTER 15 Introduction to Templates
Comparison with Generics
Syntactic Differences
Summary
Compilation Process
Templates Don't Really Exist
Constraining Freedom Is a Good Thing
The Template Paradigm
Specialization
Partial Specialization
Partial Ordering of Function Templates
Nontype Template Parameters
Complex Numbers
Overview
Mathematical Formulas
Generic Implementation
Templates to the Rescue
Core Differences: Templates and Generics
Summary
CHAPTER 16 Advanced Generics and Casts
Constraints
Kinds of Constraints
Type Constraints
Satisfying Type Constraints
The gcnew Constraint
The value class Constraint
The ref class Constraint
Summary
Cast Operators
Runtime Type Identification
const_cast()
static_cast()
dynamic_cast()
reinterpret_cast()
safe_cast()
An Adder
Generic Delegates
Summary
CHAPTER 17 The Preprocessor
C# Preprocessor Commands
Code Regions
Conditional Code Compilation
C++ Preprocessor Commands
Full Text Substitution Language
Debugging Support
Function Syntax
Concatenation Operator
String Operator
Macros on Macros
Special Preprocessor Predefined Macros
#define
#undef
Conditional Directives
#include
#using
#error
#pragma
Some Useful Pragmas
Summary
CHAPTER 18 Native C++
The iostream Library
Pointers to Members
Operators new and delete
/Zc:forScope
/Zc:wchar_t
Default Parameters
C++ Runtime Library Functions
stdio.h
stdlib.h
Other Include Files
STL
vector
deque
list
auto_ptr
Summary
CHAPTER 19 Multiple Language Support
.NET Language Integration
Gathering Metadata
Tracking Students Example
Summary
.NET Interoperability
Wait for the Beep
C# Platform Invoke
C++ Built-in Support
Using C++ for C# InterOp
Summary
CHAPTER 20 Final Thoughts
Standard Dispose Pattern
Destructors and Finalizers
Implementation in C#
Implementation in C++/CLI
For Further Study
Function Objects
Special Pointers
Interior Pointers
Pinning Pointers
Templates Revisited
Class Hierarchy Pitfalls
Type Aliases (typedef)
Friends
Volatile Data
Constant and Mutable Data
Attributes
More on IntelliSense and Source Browsing
Summary
INDEX
Published
22 Nov 2006
Publisher
APRESS
ISBN
9781590596081
Pages
380




Static Book Details Index Page - Click Here to go to Computer Manuals Website