作者rollingcom (不是lolicon)
看板C_Sharp
标题[问题] 呼叫unmanaged C++ function
时间Tue Jun 24 22:46:47 2008
我想用DllImport的方法,假如我这个C++ function是做sorting, input是int array
prototype是 void sort(int *buf, int count);
那我C#里面用的型别应该要是什麽呢?
[DllImport("test.dll")]
protected static extern void sort(int[] buf, int count);
这样可以吗?
--
※ 发信站: 批踢踢实业坊(ptt.cc)
◆ From: 220.138.75.52
※ 编辑: rollingcom 来自: 220.138.75.52 (06/24 22:51)
1F:→ hamsters:可以 06/25 00:18
2F:→ luse:记得要加extern "C" 减少困扰 XD 06/25 12:58
3F:→ rollingcom:我用DEF档,好像可以不用管extern "C"的样子:P 06/25 21:26