All-In-One Interop and Fusion Code Samples
All-In-One Interop and Fusion Code Samples
Introduction
The All-In-One Interop and Fusion code samples demonstrate the typical programming topics about .NET - native interop, COM interop, fusion, .NET Reflection, etc. These topics are either frequently asked in MSDN forums and Microsoft Support, or are requested by many developers via our code sample request function. We want to alleviate the frustration felt by developers when they are interoperating between .NET and native, or loading libraries.
Visual Studio 2008 Code Samples
Sample | Description | Download | ReadMe |
CppCallNETAssemblyWrapper | The code sample demonstrates how a native C++ project can invoke a .NET assembly via a C++/CLI wrapper. The CppCallNETAssemblyWrapper, CppCLINETAssemblyWrapper and CSClassLibrary samples work together to illustrate the interop scenario. | Download | ReadMe.txt |
CppCLINativeDllWrapper | The code sample demonstrates using C++/CLI to wrap a native DLL. Your .NET project can reference the C++/CLI wrapper to indirectly call the native DLL | Download | ReadMe.txt |
CppCLINETAssemblyWrapper | The code sample demonstrates using C++/CLI to wrap a .NET class library. Your native C++ project can import the C++/CLI wrapper to indirectly call the .NET class library | Download | ReadMe.txt |
CppHostCLR | The code sample uses the CLR 2 hosting APIs to host CLR in a native C++ project, load and invoke .NET assemblies | Download | ReadMe.txt |
CppRegFreeCOMClient | This sample demonstrates how to create a registration-free COM from the native VC++ based client, so that the client can consume existing COM server as if the COM server is Registration-free | Download | ReadMe.txt |
CSActiveX | The code sample demonstrates creating an ActiveX control in VC# | Download | ReadMe.txt |
CSCallNativeDllWrapper | The code sample demonstrates how a VC# project can invoke the functions and classes exported by a native DLL via a C++/CLI wrapper. The CSCallNativeDllWrapper, CppCLINativeDllWrapper and CppDynamicLinkLibrary samples work together to illustrate the intero | Download | ReadMe.txt |
CSCOMClient | The sample demonstrates the different ways to invoke COM objects from VC# | Download | ReadMe.txt |
CSCOMService | The sample demonstrates an out-of-process COM/DCOM service in the form of Windows Service (EXE), which is implemented entirely in Visual C#. | Download | ReadMe.txt |
CSDllCOMServer | This VC# code sample focuses on exposing .NET Framework components to COM, which allows us to write a .NET type and consuming that type from unmanaged code with distinct activities for COM developers | Download | ReadMe.txt |
CSExeCOMServer | The sample demonstrates an out-of-process COM server in the form of local server (EXE), which is implemented entirely in Visual C#. | Download | ReadMe.txt |
CSLoadLibrary | This VC# sample demonstrates dynamically load a native DLL by P/Invoking LoadLibrary, and invoke its exported functions | Download | ReadMe.txt |
CSPInvokeDll | This code sample demonstrates P/Invoking a native DLL in a .NET project | Download | ReadMe.txt |
CSRegFreeCOMClient | This sample demonstrates how to create a registration-free COM from the aspect of .NET Framework based client, so that the client can consume existing COM server as if the COM server is Registration-free | Download | ReadMe.txt |
CSRegFreeCOMServer | The sample demonstrates a .NET Framework-based component which is ready for registration-free activation. | Download | ReadMe.txt |
VBActiveX | The code sample demonstrates creating an ActiveX control in VB | Download | ReadMe.txt |
VBCallNativeDllWrapper | The code sample demonstrates how a VB project can invoke the functions and classes exported by a native DLL via a C++/CLI wrapper. The CSCallNativeDllWrapper, CppCLINativeDllWrapper and CppDynamicLinkLibrary samples work together to illustrate the interop | Download | ReadMe.txt |
VBCOMClient | The sample demonstrates the different ways to invoke COM objects from VB | Download | ReadMe.txt |
VBDllCOMServer | This Visual Basic sample focuses on exposing .NET Framework components to COM, which allows us to write a .NET type and consuming that type from unmanaged code with distinct activities for COM developers | Download | ReadMe.txt |
VBExeCOMServer | The sample demonstrates an out-of-process COM server in the form of local server (EXE), which is implemented entirely in Visual Basic. | Download | ReadMe.txt |
VBLoadLibrary | This VB sample demonstrates dynamically load a native DLL by P/Invoking LoadLibrary, and invoke its exported functions | Download | ReadMe.txt |
VBPInvokeDll | This code sample demonstrates P/Invoking a native DLL in a .NET project | Download | ReadMe.txt |
VBRegFreeCOMServer | The sample demonstrates a .NET Framework-based component which is ready for registration-free activation. | Download | ReadMe.txt |
Visual Studio 2010 Code Samples
Sample | Description | Download | ReadMe |
CppHostCLR | The code sample uses the CLR 4 hosting APIs to host CLR in a native C++ project, load and invoke .NET assemblies | Download | ReadMe.txt |
CSSL4COMInterop | This project demonstrates how to inter-operate with COM components in Silverlight 4. | Download | ReadMe.txt |
VBSL4COMInterop | This project demonstrates how to inter-operate with COM components in Silverlight 4. | Download | ReadMe.txt |
Download all code samples: https://1code.codeplex.com/releases
Submit your request of Interop and Fusion code samples (Guidance)