using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; // DllImportに必要 using System.Runtime.InteropServices; namespace UseMyDLL { class Program { [DllImport("MyDLL.dll", CallingConvention = CallingConvention.Cdecl)] private extern static int add(int a, int b); // ポインタはC#側ではIntPtrに [DllImport("MyDLL.dll", CallingConvention = CallingConven