【发布时间】:2012-04-05 00:22:50
【问题描述】:
这就是它在 C++ 中的样子:
[DllImportAttribute("Win32DLLRecon.dll", CharSet=CharSet::Auto, CallingConvention=CallingConvention::StdCall)]
extern "C" void proc1
(__int32 *i1,
__int16 *i2,
__int16 *i3,
char *i4,
unsigned *i5,
unsigned char *o1,
unsigned __int16 *o2,
float *o3);
其中 i = 输入,o = 输出
什么是 C# 等价物?
我试图指定类似的数组,例如“out Byte [] output”,但它抱怨它需要 byte*,而不是 byte[](我确实需要在代码中使用指针)。
编辑:
如果我只是将我的整个类声明为不安全并将它们作为指针传递会发生什么:extern proc (out Byte* output, etc)?
【问题讨论】:
-
参数名称和 cmets 都经过精心设计,不会让您得到答案。
-
我修改了名字,希望现在更清楚了。
-
拜托,谁能看看!!!
标签: c# pointers c++-cli dllimport