这个c++接口怎么转换为c#???

zzyhost 2020-06-17 06:13:19
如下是文档给的c++接口,怎么用c#声明?

short USER_API dc_SamAReadCardInfo ( HANDLE icdev,
int type,
int * text_len,
unsigned char * text,
int * photo_len,
unsigned char * photo,
int * fingerprint_len,
unsigned char * fingerprint,
int * extra_len,
unsigned char * extra
)

这是我自己写的,不行,程序直接卡死退出
[DllImport("dcrf32.dll")]
private static extern short dc_SamAReadCardInfo(
IntPtr handle,
int type,
out int text_len,
out byte[] text,
out int photo_len,
out byte[] photo,
out int fingerprint_len,
out byte[] fingerprint,
out int extra_len,
out byte[] extra);
...全文
7589 2 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
葛雷亚斯 2020-06-23
  • 打赏
  • 举报
回复
上面那个就可以了,还有种笨方法 你不确定 * 怎么写的时候 全用Intptr
杀马特丶蛮牛 2020-06-19
  • 打赏
  • 举报
回复
public static extern short dc_SamAReadCardInfo(System.IntPtr icdev, int type, ref int text_len, System.IntPtr text, ref int photo_len, System.IntPtr photo, ref int fingerprint_len, System.IntPtr fingerprint, ref int extra_len, System.IntPtr extra) ;

111,098

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • AIGC Browser
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧