第一次做证件扫描的程序,本以为调用个API函数应该没什么难度的,可是今天才发现出的错真的很有难道,找了一天也没找到解决办法,请大家帮帮忙
程序在执行到这时:int aa = RecogIdcardExALL(image_file, card, true, 0, 31, HeadImgName, 1);
这个方法就是调用的DLL文件中的一个方法
现在的情况是证件已经扫描上了,并生成了图片
但是执行来这句就不执行下面的代码,并生成这个错误
“0x04b23cb2”指令引用的"0x00000000"内存,该内存不能为“written”这是怎么回事??

解决方案 »

  1.   

    true -> 1
      

  2.   

    这是加载的API C# code
    [DllImport("idcarddll.dll", EntryPoint = "RecogIdcardExALL")]
            public static extern int RecogIdcardExALL(string image_file, IDCARD_ALL card, bool  bSaveResultFile, int nHandPrint, int nContent, string HeadImgName, short nButtonDown);
    IDCARD_ALL card 是个结构体 实例化一个结构体是不是可以这样?IDCARD_ALL card = new IDCARD_ALL(); 这是调用且给它传的参数: 
    int aa = RecogIdcardExALL(image_file, card, true, 0, 31, HeadImgName, 1); 现在扫描证件已经完成,但是出了个错“0x04b23cb2”指令引用的"0x00000000"内存,该内存不能为“written” 这是怎么回事??