运行库遇到了错误。此错误的地址为 0x7a0a71cc,在线程 0x530 上。错误代码为 0xc0000005。此错误可能是 CLR 中的 bug,或者是用户代码的不安全部分或不可验证部分中的 bug。此 bug 的常见来源包括用户对 COM-interop 或 PInvoke 的封送处理错误,这些错误可能会损坏堆栈。代码如下
[DllImport("WIS_API.dll", EntryPoint = "WIS_Enroll")]
public  extern static int WIS_Enroll(int hInit,ref byte rEnrlTemplate);....
....
byte EnrlTemplate = 0;
int lQuality = WIS_Enroll(m_hInit,ref EnrlTemplate);//出粗语句

解决方案 »

  1.   

    原型介绍WIS_Enroll
    Synopsis
    int WINAPI WIS_Enroll(HANDLE hInit, unsigned char *rEnrlTemplate )
    Parameter
    hInit
    The handle returned by WIS_InitDriver()
    rEnrlTemplate
    The final fingerprint code to represent the feature of a fingerprint if the enrollment is successful.
    Description
    Generate a final fingerprint code of 160/320/480 bytes.
    Return Value
    i.
    QUALITY _A, QUALITY B, QUALITY C, QUALITY D: The quality of enrolled fingerprint.
    ii.
    QUALITY_NOT_YET : Enrollment is not completed yet.
    ii.
    Others < 0 : Image quality is not good enough.
    Res
    This function generates the final fingerprint code rEnrlTemplate from several input RawTemplate by collecting their common features. The purpose of enrollment is to get enough stable characteristics to represent the corresponding fingerprint.
    you should call WIS_ReleaseEnroll() to release the system resource. Basically, the kernel process of enrollment works in a continuous loop as following:
    1.
    Use WIS_Snap() or WIS_Capture to get a good-enough fingerprint.
    2.
    call WIS_Enroll().
    3.
    If the return value is not one of the qualities defined, repeat step 1 and step 2 until the quality of the fingerprint is derived.
    4.
    Trials for more than 5 times and still cannot get the quality of the finger, that means the finger to enroll may not be good enough. You should change to another finger and restart the enrollment.
    5.
    If you want to improve the enrolled quality, you can continue executing step 1 to step 3 to get a better final fingerprint code with better quality.
    6.
    If you have tried to enhance the enrolled quality more than 3 times but the quality still remains in a certain quality without any improvement, it seems that the enrolled quality has been stable. Any attempt to enhancement may be in vain. You should stop the enrollment with the stable enrolled quality. If you are not satisfied with the current enrolled quality, choose another finger and restart the enrollment.
    7.
    call WIS_ReleaseEnroll() to free the resource.
    所以你声明错了,没测试。你试试这样[DllImport("WIS_API.dll", EntryPoint = "WIS_Enroll")]
    int WINAPI WIS_Enroll(IntPtr hInit, StringBuilder rEnrlTemplate );
      

  2.   

    逍遥,我看了VB的demo,就是和我一样声明的啊!而且是可以运行的!我前面也是可以运行的,刚刚忽然发现原来错在这个变量上m_hInit;
    因为前面运行都对的,所以我也很困惑了
      

  3.   

    我根本不没用过这个。我只是看下面连接的pdf看到声明而已。
    http://www.betasoft-srl.com.ar/dwld/std/doc/OR100/ProgrammerGuide.pdf
    http://www.datacap.com.ar/fp5311_guia_prog.pdf