| About the Author | p. xi |
| About the Technical Reviewers | p. xiii |
| Acknowledgments | p. xv |
| Introduction | p. xvii |
| Using C-Style APIs | p. 1 |
| Identifying the Unmanaged Function | p. 2 |
| Using the Function from Managed Code | p. 5 |
| Simplifying Reuse of Unmanaged Functions | p. 8 |
| Changing the Calling Convention | p. 14 |
| Renaming a Function | p. 16 |
| Changing the Character Set Used for Strings | p. 21 |
| Using Data Types That Improve Performance | p. 25 |
| Handling Errors from Unmanaged Functions | p. 32 |
| Using C++ Interop As a Managed Wrapper | p. 41 |
| Catching Unmanaged Exceptions with C++ Interop | p. 50 |
| Freeing Unmanaged Memory | p. 58 |
| Requesting Permission to Access Unmanaged Code | p. 65 |
| Securing Access to Unmanaged Code | p. 72 |
| Calling Functions Dynamically | p. 83 |
| C-Style APIs: Structures, Classes, and Arrays | p. 87 |
| Passing Structures | p. 88 |
| Returning a Structure from Unmanaged Code | p. 92 |
| Specifying the Exact Layout of a Structure | p. 97 |
| Controlling Field-Level Marshaling Within Structures | p. 104 |
| Allocating Memory Within Structures | p. 110 |
| Passing Classes to Unmanaged Code | p. 116 |
| Passing Simple Arrays | p. 126 |
| Handling String Arrays | p. 130 |
| Passing Arrays of Structures | p. 137 |
| Win32 API | p. 141 |
| Accessing ANSI or Wide Functions | p. 141 |
| Retrieving the Win32 Error Code | p. 147 |
| Handling Callbacks | p. 152 |
| Using Windows Constants | p. 156 |
| Handling Handles | p. 167 |
| Passing Managed Objects | p. 173 |
| Marshaling Win32 Types | p. 177 |
| Replacing Win32 Calls with .NET | p. 179 |
| Using C++ Interop | p. 191 |
| Using C++ Classes | p. 193 |
| Mixing Managed and Unmanaged Code | p. 199 |
| Detecting Compile-Time Traits | p. 205 |
| Using Managed Objects from Unmanaged Code | p. 209 |
| Marshaling Strings | p. 216 |
| Marshaling Structures and Embedded Pointers | p. 220 |
| Handling Callbacks with C++ Interop | p. 224 |
| Using C++ As a Custom COM Wrapper | p. 230 |
| Using COM | p. 235 |
| Using COM Components from .NET | p. 236 |
| Importing a Type Library | p. 242 |
| Handling COM Events | p. 248 |
| Marshaling COM Data Types | p. 256 |
| Marshaling COM Variants | p. 263 |
| Marshaling COM Arrays | p. 272 |
| Extending COM Classes | p. 281 |
| Changing the Apartment Model | p. 290 |
| Refactoring for Performance | p. 296 |
| Creating a Late-Bound COM Object | p. 298 |
| Sharing an Interop Assembly | p. 303 |
| Deploying Your Application | p. 306 |
| Converting HRESULTs to Exceptions | p. 308 |
| Refactoring HRESULTs | p. 314 |
| Retrieving the HRESULT | p. 319 |
| Providing Additional Error Information | p. 322 |
| Exposing Managed Code to COM | p. 327 |
| Exposing .NET Classes Using Late Binding | p. 328 |
| Exposing .NET Classes Using Early Binding | p. 332 |
| Exposing .NET Classes with Interfaces | p. 338 |
| Managing COM Identity | p. 346 |
| Controlling COM Visibility | p. 353 |
| Preparing Assemblies for COM Interop | p. 361 |
| Exposing Managed Events to COM | p. 364 |
| Providing HRESULTs for Exceptions | p. 369 |
| Preserving Success HRESULTs | p. 374 |
| Marshaling to COM Clients | p. 379 |
| Controlling Parameter Direction | p. 379 |
| Marshaling Strings | p. 392 |
| Marshaling Arrays | p. 402 |
| Marshaling Variants | p. 414 |
| Marshaling Currency | p. 418 |
| Marshaling Null Variant Strings | p. 423 |
| Marshaling Classes and Structures | p. 426 |
| Passing Optional Parameters | p. 436 |
| COM+ Enterprise Services | p. 441 |
| Exposing Managed Code to COM+ | p. 442 |
| Implementing a Server Application | p. 448 |
| Installing a Serviced Component | p. 453 |
| Registering Components Dynamically | p. 456 |
| Activating Components Just-in-Time | p. 459 |
| Using Object Pooling | p. 467 |
| Implementing Private Components | p. 475 |
| Using Role-Based Security | p. 479 |
| Performing Manual Security Checks | p. 488 |
| Writing Managed Queued Components | p. 493 |
| COM+ Enterprise Services Transactions | p. 503 |
| Monitoring Transaction Status | p. 504 |
| Enabling Automatic Transactions | p. 515 |
| Placing an Automatic Vote | p. 528 |
| Placing a Manual Vote | p. 535 |
| Defining a Unit of Work | p. 544 |
| Controlling the Transaction Isolation Level | p. 556 |
| Implementing Transactional Code Blocks | p. 558 |
| Building Your Own Resource Manager | p. 564 |
| Using Services Without Components | p. 577 |
| Index | p. 583 |
| Table of Contents provided by Ingram. All Rights Reserved. |