Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/corytodd/interop-example

C# CLR Win32 Interop Example
https://github.com/corytodd/interop-example

Last synced: 2 days ago
JSON representation

C# CLR Win32 Interop Example

Awesome Lists containing this project

README

        

# Interop Example
C# CLR Win32 Interop Example Project

This example was written in Visual Studio 2013 using C# .NET 4.5 , C++/CLR, and Win32 C++. The purpose of this project is to demonstrate how to use CLR wrappers to utilize native Win32 libraries from within C#.

For simplicity, the MathFunc dll is taken from the [official Microsoft dll walkthrough](https://msdn.microsoft.com/en-us/library/ms235636.aspx).

The CLR wrapper and C# code was developed by me to learn and share how to achieve interoperation between native libraries and C# .NET without the use of P/invoke.

### Important Note:

The C# executable requires the MathFuncDll to be in working directory. A post-build event was added to automatically copy the dll into the output directory to avoid the FileNotFound issue.