[DllImport(@"C:\..\lib\DLLDemo.dll", EntryPoint = "math_add", CallingConvention = CallingConvention.StdCall)] public static extern int Add(int a, int b); [DllImport("user32.dll")] public static extern int MessageBox(IntPtr hWnd, String text, String caption, int options); public static void Main(string[] args) { int result = Add(14, 54); Console.WriteLine("result is {0}", result); Console.ReadKey(); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)