Well I think that should not be to dificult. You can use DllImport statement to call any c++ dll library or function.
For example you have following c++ function in a dll.
int Sum(int x, int y) { return x+y; }
And you want to use this function in c# application. So you can useit like this.
using System; using System.Collections.Generic; using System.Text; using System.Runtime.InteropServices; //For "DllImport" namespace MyCSharp { class Program { [DllImport("MathFuncsDll.dll", CharSet = CharSet.Auto)] public static extern Int32 Sum(Int32 a, Int32 b); static void Main() { Console.WriteLine(Sum(3, 4)); } } }
Liked By
Write Answer
Calling C function in .net.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy
Join MindStick Community
You have need login or register for voting of answers or question.
Anonymous User
16-Apr-2011Well I think that should not be to dificult. You can use DllImport statement to call any c++ dll library or function.
For example you have following c++ function in a dll.
And you want to use this function in c# application.
So you can useit like this.