This page links to help on tasks related to interop using Visual C++. To view other categories of popular tasks covered in Help, see How Do I in Visual C++.
CLR/Native Interoperability
- Mixed, Pure, and Verifiable Feature Comparison
-
Compares features across the three difference /clr compilation modes.
- How To: Migrate to /clr
-
Discusses issues that arise when compiling native code with /clr and when converting a project to managed.
- How to: Compile MFC and ATL Code with /clr
-
Discusses how to compile existing MFC and ATL programs to target the Common Language Runtime.
- Mixed (Native and Managed) Assemblies
-
Describes how developers can author applications using a mixture of managed and unmanaged functionality.
- Performance Considerations for Interop (C++)
-
Provides guidelines for reducing the effect of managed/unmanaged interop transitions on run-time performance.
- How to: Marshal ANSI Strings Using C++ Interop
-
Demonstrates using C++ Interop to marshal ANSI strings between managed and native code.
- How to: Marshal Unicode Strings Using C++ Interop
-
Demonstrates using C++ Interop to marshal Unicode strings between managed and native code.
- How to: Marshal COM Strings Using C++ Interop
-
Demonstrates using C++ Interop to marshal COM strings between managed and native code.
- How to: Marshal Structures Using C++ Interop
-
Demonstrates using C++ Interop to marshal structs between managed and native code.
- How to: Marshal Arrays Using C++ Interop
-
Demonstrates using C++ Interop to marshal arrays between managed and native code.
- How to: Marshal Callbacks and Delegates Using C++ Interop
-
Demonstrates using C++ Interop to marshal callbacks and delegates between managed and native code.
- How to: Marshal Embedded Pointers Using C++ Interop
-
Demonstrates using C++ Interop to marshal embedded pointers between managed and native code.
- Using Native COM Servers from .NET
-
Describes the available options for using existing COM components from .NET applications and outlines the advantages and disadvantages of each approach.
- How to: Use Native COM Servers with TLBIMP
-
Demonstrates how COM objects can be used from managed code using the Type Library Importer (Tlbimp.exe) tool.
- How to: Use Native COM Servers with CRCWs
-
Demonstrates how COM objects can be used from managed code using Custom Runtime Callable Wrappers.
- Exposing .NET Framework Components to COM
-
Describes several tips for writing managed code that interoperates with COM clients.
- How to: Marshal Strings Using PInvoke
-
Explains how native functions that accept C-style strings can be called using the CLR string type System.String using Platform Invoke (P/Invoke) functionality.
- How to: Call Native DLLs from Managed Code Using PInvoke
-
Demonstrates how functions that are implemented in unmanaged DLLs can be called from managed code using Platform Invoke (P/Invoke) functionality.
- How to: Marshal Structures Using PInvoke
-
Explains how native functions that accept C-style structs can be called from managed code using Platform Invoke (P/Invoke) functionality.
- How to: Marshal Arrays Using PInvoke
-
Explains how native functions that accept C-style arrays can be called from managed code using Platform Invoke (P/Invoke) functionality.
- How to: Marshal Function Pointers Using PInvoke
-
Explains how managed delegates can be used in place of function pointers when interoperating with unmanaged functions using Platform Invoke (P/Invoke) functionality.
- How to: Marshal Embedded Pointers Using PInvoke
-
Explains how to marshal embedded pointers using Platform Invoke (P/Invoke) functionality.
Using Windows Forms in MFC
- Using a Windows Form User Control in MFC
-
Explains how you can use the MFC Windows Forms support classes to host Windows Forms controls within your MFC applications as ActiveX controls within MFC dialog boxes or views.
- Windows Forms/MFC Programming Differences
-
Provides background information about programming differences between Windows Forms and MFC.
- Hosting a Windows Form User Control as an MFC Dialog Box
-
Describes how to host a Windows Forms Control as an MFC Dialog Box using the CWinFormsDialog class.
- How to: Create the User Control and Host MDI View
-
Shows how to create a .NET Frameworks user control, author the user control in a control class library (specifically, a Windows Control Library project), and then compile the project into an assembly.
- How to: Add Command Routing to the Windows Forms Control
-
Demonstrates how to use CWinFormsView to route commands and update command UI messages to the user control to allow it to handle MFC commands.
- How to: Call Properties and Methods of the Windows Forms Control
-
Explains why it is advisable to add a member of the user control type and initialize it in IView::OnInitialUpdate.
- Hosting a Windows Form User Control as an MFC View
-
Describes how to host a Windows Forms User Control as an MFC View.
- How to: Create the User Control and Host in a Dialog Box
-
Explains how to add a user control to a new dialog-based MFC project.
- How to: Do DDX/DDV Data Binding with Windows Forms
-
Shows how to bind a native C++ string to a .NET user control.
- How to: Sink Windows Forms Events from Native C++ Classes
-
Shows how to enable native C++ classes to receive callbacks from managed events raised from Windows Forms controls or other forms with the MFC macro map format. Sinking events in views and dialogs is similar to doing the same task for controls.
- Hosting a Windows Form User Control in an MFC Dialog Box
-
Describes how to host a Windows Forms user control in an MFC dialog box.
Concepts
How Do I in Visual C++