c#调用DLL文件发生错误!!请高手指点,急~~

呦呦 2008-11-06 02:41:00
c#调用DLL文件发生错误!!应用程序发生错误,未知的软件异常

[DllImport("idcarddll.dll", EntryPoint = "RecogNewIdcardALL ",
CharSet = CharSet.Ansi, CallingConvention = CallingConvention.StdCall)]
public static extern int RecogNewIdcardALL(string imgfile_name, ref IDCARD idcard, bool bSaveResultFile, int nContent, string HeadImgFName);

结构体
public struct IDCARD
{
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 7)]
public string name; //姓名
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 10)]
public string sex; //性别
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 20)]
public string people; //民族,
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 50)]
public string birthday; //出生日期
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 200)]
public string address; //地址,
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 50)]
public string signdate; //签发日期,
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 10)]
public string validterm; //有效期,
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 40)]
public string number; //证件编码,
[MarshalAs(UnmanagedType.ByValTStr, SizeConst = 100)]
public string other; //备用,
};

...全文
99 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
li45214521 2008-11-06
  • 打赏
  • 举报
回复
public fixed byte name[7];
zhirom 2008-11-06
  • 打赏
  • 举报
回复
会不会是Ansi和unicode的问题哦
呦呦 2008-11-06
  • 打赏
  • 举报
回复
天呐,高手都哪去啦~~快救命啊!!
dingxuewhlg 2008-11-06
  • 打赏
  • 举报
回复
不懂
只能够帮顶了……
呦呦 2008-11-06
  • 打赏
  • 举报
回复
就快要大功告成了!!高手快来呀~~
呦呦 2008-11-06
  • 打赏
  • 举报
回复

高手快来呀,急~~

111,098

社区成员

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

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

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