Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

Managed Extensions for C++ and COM Interoperability Tutorial

Visual Studio .NET 2003

Legacy COM servers provide functionality that you can leverage with various tools, but these tools only work well with simple interfaces. With Managed Extensions for C++, you can expose the functionality of COM objects with complex interfaces to managed code.

In this tutorial, you will perform the following tasks:

  • Generate a nontrivial COM component.
  • Use the component from an unmanaged C++ client.
  • Use the component from a Managed Extensions for C++ console application.
  • Implement a wrapper class in a managed class library assembly to make the component available to other .NET-enabled languages.

In This Section

Introduction
Discusses the benefits of custom runtime callable wrapper classes and briefly covers issues with using TlbImp.exe.
Example COM Component
Describes a COM component named CCustomDate, which manipulates a custom structure.
Using the Component from an Unmanaged C++ Client
Provides a simple unmanaged client for CCustomDate.
Using the Component from a .NET Console Application
Provides a managed console client that uses the unmanaged COM component.
Using TlbImp.exe-Generated Interop Assemblies
Discusses the issues with using TlbImp.exe for interoperability assemblies.
Implementing a Custom Runtime Callable Wrapper
Describes the preferred way for creating an interoperability assembly that exposes equivalent .NET data types.

Related Sections

Tutorials
Provides advanced tutorials on using Managed Extensions for C++ and interoperating with managed and unmanaged code.
Adding Functionality
Provides links to topics discussing how to write code with Managed Extensions.
Reference
Provides links to reference material on keywords, pragmas, compiler and linker options, attributes, and preprocessor directives.
Samples
Provides links to samples that show how to use Managed Extensions to write .NET Framework applications.
Show:
© 2015 Microsoft