Tài liệu COM and .NET Interoperability

Thảo luận trong 'Lập Trình' bắt đầu bởi Thúy Viết Bài, 5/12/13.

  1. Thúy Viết Bài

    Thành viên vàng

    Bài viết:
    198,891
    Được thích:
    173
    Điểm thành tích:
    0
    Xu:
    0Xu
    COM and .NET Interoperability
    Introduction
    Chapter 1: Understanding Platform Invocation Services

    Understanding the C-Style DLL
    Building a Custom C-Based DLL
    Viewing Your Imports and Exports Using dumpbin.exe
    Deploying Traditional DLLs
    A Dynamic C++ DLL Client
    The Atoms of PInvoke
    A Trivial PInvoke Example
    Interacting with MyCustomDLL.dll
    Working with Unmanaged Callbacks
    A Simple Callback Example
    A More Interesting Callback Function
    Building a C# Callback Client
    Summary
    Chapter 2: The Anatomy of a COM Server
    The Composition of a COM DLL
    The Role of Type Libraries
    The Role of the System Registry
    Creating the COM DLL Project Workspace
    Understanding COM Interfaces
    A Brief Word on COM-Centric Macros
    Implementing the ComCar
    Understanding IClassFactory
    Building Your Class Factory
    Implementing DLL Component Housing
    Exporting the Exports
    Registering the COM Server
    Developing a C++ COM Client
    Understanding COM Properties
    Building Scriptable Objects (Using IDispatch)
    The VARIANT Data Type
    A C++ IDispatch Example
    A Visual Basic IDispatch Client
    Understanding the Dual Interface
    Defining a Scriptable Object
    Building the Class Factory
    Updating DllGetClassObject
    Updating the Server's Registration File
    Building a VBScript Late-Bound Client
    Summary
    Chapter 3: A Primer on COM Programming Frameworks
    The Role of Visual Basic 6.0
    Summary
    Chapter 4: COM Type Information
    The Format of a COM IDL File
    Defining COM Types
    Primitive COM Data Types
    IDL Method Parameter Attributes
    Defining COM Interface Types in IDL
    The ITypeInfo Interface
    Generating COM Type Information Programmatically
    Building the Type Library (ICreateTypeLib)
    Creating the IHello Interface
    Building the SayHello() Method
    Building the Hello Coclass
    Testing the Application
    Programmatically Reading COM Type Information
    Defining Custom IDL Attributes
    Introducing the System.Runtime.InteropServices Namespace
    Building a C# COM Type Information Viewer
    Summary
    Chapter 5: The Anatomy of a .NET Server
    The Philosophy of .NET
    The Building Blocks of .NET
    Working with Managed Languages
    The Composition of a .NET Binary
    Building a C# Code Library
    Introducing ILDasm.exe
    Building a Managed Client
    Specifying Arbitrary Assembly Locations
    Understanding the Shared Assembly
    Using the Shared Assembly
    Versioning Shared Assemblies
    Working with Publisher Policy Assemblies
    And Now for Something Completely Different: System.CodeDOM
    Introducing the System.CodeDOM Namespace
    Compiling the Assembly
    Summary
    Chapter 6: .NET Types
    Examining the .NET Data Type System
    The Set of Custom .NET Types
    Building a Complex Code Library
    Understanding Reflection
    Working with System.Type
    The System.Reflection Namespace
    Dynamically Loading an Assembly
    Building a Custom .NET Type Viewer
    A Brief Word Regarding System.Reflection.Emit
    Understanding .NET Attributes
    Creating and Applying Custom Attributes
    Reading Attributes at Runtime
    Binding Late to Shared Assemblies
    Summary
    Chapter 7: .NET-to-COM Interoperability¡ªThe Basics
    Building an Interop Assembly¡ªThe Simplest Possible Example
    Converting Between COM IDL Data Types and Managed Data Types
    Interfaces Consumed by the RCW
    Options to Obtain an Interop Assembly
    Examining the Generated .NET Types
    Select Members of the System.Runtime.InteropServices Namespace
    COM Library Statement to .NET Assembly Statement Conversion Rules
    COM Types to .NET Types Conversion Rules
    Deploying Interop Assemblies
    Creating a Primary Interop Assembly
    Reflecting on Interop Assembly Attributes
    Interacting with Well-Known COM Servers
    Summary
    Chapter 8: .NET-to-COM Interoperability¡ªIntermediate Topics
    Building a VARIANT-Centric COM Server
    Handling COM SafeArrays
    Handling C-Style Arrays
    Handling COM Param Arrays
    Handling COM Structures
    Handling COM Collections
    A Brief Review of COM Connection Points (COM Events)
    Building a Connectable COM Type
    A Brief Review of .NET Delegates
    A Brief Review of .NET Events
    Examining the Interop Assembly
    Handling COM Error Objects
    The .NET Error Handling Mechanism
    Debugging COM Servers Using VS .NET
    Summary
    Chapter 9: .NET-to-COM Interoperability¡ªAdvanced Topics
    COM Coclasses Implementing .NET Interfaces
    Guidelines for Building .NET Type Compatible COM Classes
    Consuming ActiveX Controls from Managed Code
    Options for Consuming ActiveX Controls from Managed Code
    Modifying the Code for the AxHost-Derived Type
    Manually Modifying Interop Assemblies
    Understanding the Interop Editing Process
    Dissecting the Layout of Attribute Metadata
    Building a Scratch Assembly
    Building the Managed Client
    Building a Custom Type Library Importer Utility
    Building the Main Shell
    Summary
    Chapter 10: COM-to-.NET Interoperability¡ªThe Basics
    Core Requirements for COM-to-.NET Communications
    Using the tlbexp.exe Utility
    General Guidelines for Building COM-Aware .NET Types
    Critical .NET-to-COM Conversion Details
    Understanding the Class Interface
    Understanding the _Object Interface
    The Case Against Class Interfaces
    Exposing Custom .NET Interfaces to COM
    Implementing Explicit Interfaces
    Controlling the Generated ProgID
    Controlling the COM Library Definition
    Handling Overloaded Methods
    Importing mscorlib.tlb
    Using the regasm.exe Utility
    Examining the Updated Entries
    Deploying the .NET Assembly
    Leveraging the Visual Studio .NET IDE
    Building a Visual Basic 6.0 COM Client
    Building a C++ COM Client
    Building a VBScript COM Client
    Summary
    Chapter 11: COM-to-.NET Interoperability¡ªIntermediate Topics
    Converting .NET Structures to COM Structures
    Converting .NET Delegates to COM Connection Points
    Building a .NET Event Server Using VB .NET
    Building a Visual Basic 6.0 Event Client
    Building a C++ Event Client
    Exposing Custom .NET Collections
    Exposing .NET Exceptions
    Exercising Your DotNetCollection Assembly from C++
    Converting .NET Interface with Multiple Base Interfaces
    Converting .NET Interface Hierarchies
    Summary
    Chapter 12: COM-to-.NET Interoperability¡ªAdvanced Topics
    .NET Types Implementing COM Interfaces
    Defining Custom COM Interfaces
    Building a VB 6.0 COM Client
    Defining COM Interfaces Using Managed Code
    Manually Defining COM Atoms: An Extended Example
    Interacting with Interop Assembly Registration
    Programmatically Converting Assemblies to COM Type Information
    Hosting the .NET Runtime from an Unmanaged Environment
    Summary
    Chapter 13: Building Serviced Components (COM+ Interop)
    Recapping Component Services
    Reviewing the COM+ Runtime Environment
    The Role of the COM+ Catalog
    The Component Service Explorer
    A Classic COM+ Example
    Building a VB 6.0 COM+ Client
    Deploying COM+ Applications
    The System.EnterpriseServices Namespace
    The Simplest Possible Example
    Using the regsvcs.exe Command Line Utility
    Accessing the Configured .NET Component from VB 6.0
    Accessing the Configured .NET Component from C#
    Enabling Component Statistics
    A Brief Word on Lazy (Automatic) Registration
    Working with the RegistrationHelper Type
    Configuring a Managed COM+ Application Using .NET Attributes
    Supporting Object Construction Strings
    Examining the ContextUtil Type
    Understanding JITA
    JITA, IObjectControl, and the .NET Garbage Collector
    Configuring Poolable Objects
    A Recap of Transactional Programming
    Programming COM+ Transactions
    A Complete Serviced Component Example
    Final Thoughts Regarding System.EnterpriseServices
    Summary
     

    Các file đính kèm:

Đang tải...