Troelsen, Andrew.

COM and .NET interoperability / by Andrew Troelsen. - San Francisco, Calif. : Apress, 2002. - 378p. - Net developer series . - NET developer series. .

Includes index.

Understanding Platform Invocation Services The Two Faces of Unmanaged Code 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.d11 Working with Unmanaged Callbacks A Simple Callback Example A More Interesting Callback Function Building a C? Callback Client The Anatomy of a COM Server Of Classes and Interfaces 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 A Primer on COM Programming Frameworks The Role of the Active Template Library The Role of Visual Basic 6.0 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 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 .NET Types The Role of System. Object 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 .NET-to-COM Interoperability -- The Basics A High-Level Overview of .NET-to-COM Interoperability 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 .NET-to-COM Interoperability -- Intermediate Topics Handling the COM VARIANT 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 .NET-to-COM Interoperability -- Advanced Topics Revisiting the Marshal Class 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 COM-to-.NET Interoperability -- The Basics The Role of the CCW 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 COM-to-.NET Interoperability -- Intermediate Topics Converting .NET Enums to COM Enums 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 COM-to-.NET Interoperability -- Advanced Topics Changing Type Marshaling Using MarshalAsAttribute .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 Building Serviced Components (COM+ Interop) The MTS, COM+, Component Services Name Game 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 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 Chapter 1 1 -- 1 -- 2 -- 5 -- 9 -- 12 -- 15 -- 18 -- 26 -- 33 -- 42 -- 43 -- 44 -- 46 -- Chapter 2 51 -- 51 -- 63 -- 65 -- 66 -- 67 -- 68 -- 79 -- 80 -- 84 -- 85 -- 88 -- 90 -- 91 -- 97 -- 105 -- 108 -- 112 -- 116 -- 117 -- 118 -- 118 -- 123 -- 123 -- 124 -- 124 -- Chapter 3 127 -- 127 -- 146 -- Chapter 4 161 -- 162 -- 163 -- 164 -- 167 -- 171 -- 185 -- 189 -- 191 -- 193 -- 198 -- 200 -- 201 -- 203 -- 212 -- 218 -- 220 -- Chapter 5 229 -- 230 -- 231 -- 232 -- 233 -- 235 -- 243 -- 250 -- 253 -- 254 -- 262 -- 264 -- 267 -- 270 -- 272 -- 284 -- Chapter 6 289 -- 289 -- 294 -- 297 -- 302 -- 304 -- 304 -- 309 -- 310 -- 312 -- 323 -- 323 -- 325 -- 330 -- 335 -- Chapter 7 339 -- 339 -- 342 -- 346 -- 351 -- 353 -- 356 -- 362 -- 367 -- 371 -- 392 -- 393 -- 396 -- 399 -- Chapter 8 403 -- 403 -- 405 -- 410 -- 419 -- 420 -- 421 -- 426 -- 437 -- 441 -- 443 -- 445 -- 448 -- 459 -- 464 -- 468 -- Chapter 9 471 -- 471 -- 475 -- 484 -- 490 -- 495 -- 504 -- 508 -- 510 -- 517 -- 519 -- 526 -- 528 -- 530 -- Chapter 10 539 -- 539 -- 544 -- 546 -- 547 -- 554 -- 557 -- 562 -- 563 -- 564 -- 567 -- 567 -- 568 -- 569 -- 570 -- 572 -- 574 -- 582 -- 584 -- 584 -- 589 -- 590 -- Chapter 11 593 -- 593 -- 598 -- 604 -- 608 -- 609 -- 610 -- 614 -- 619 -- 621 -- 624 -- 627 -- Chapter 12 633 -- 633 -- 638 -- 638 -- 644 -- 646 -- 650 -- 653 -- 655 -- 660 -- Chapter 13 669 -- 669 -- 670 -- 672 -- 675 -- 678 -- 682 -- 683 -- 685 -- 687 -- 694 -- 698 -- 699 -- 699 -- 700 -- 701 -- 703 -- 704 -- 706 -- 708 -- 714 -- 715 -- 717 -- 720 -- 724

Andrew Troelsen explains the process of building .NET applications that are capable of interacting with existing COM code. The author provides a complete overview of COM architecture and its interaction with the Windows API.

9781590590119 (pbk.) : £28.50 9781590590119

2005297778


Microsoft .NET Framework.


Object-oriented programming (Computer science)
Computer software--Development
COM (Computer architecture)
COM (Computer architecture)
Computer programming.
Computers and IT.
Microsoft programming
Software Engineering
Programming & scripting languages: general
Computer architecture & logic design

QA76.6

005.268 TRO