2017-02-01 1 views
1

Я проверяю трассировку, которую я получаю из базы данных SQL Server, тип данных является varbinary (MAX), но я получаю это исключение, и у меня нет идея, что это может быть, я оставляю вам код запроса, где я привожу данные и метод обрабатываетОшибка с подтверждением DigitalPersona SDK Excepción от HRESULT: 0xFFFFFFE3 (ошибка SDK = -29)

Exception:

Исключение из HRESULT: 0xFFFFFFE3

от входа, за исключением (Это будет на испанском языке):

Consulte el final de este mensaje para obtener más detalles sobre cómo invocar a la depuración 
Just-In-Time (JIT) en lugar de a este cuadro de diálogo. 

************** Texto de la excepción ************** 
DPFP.Error.SDKException: Event Handler has generated an Exception ---> System.Runtime.InteropServices.COMException: Excepción de HRESULT: 0xFFFFFFE3 
    en DPFP.Verification.Verification.MC_verifyFeaturesEx(SafeHandle mcContext, Int32 templateSize, Byte[] templatePt, Int32 featureSetSize, Byte[] featureSet, Int32 reserved0, IntPtr reserved1, IntPtr reserved2, IntPtr reserved3, Double& achievedFar) 
    en DPFP.Verification.Verification.Verify(FeatureSet FeatureSet, Template Template, Int32 FARRequested) 
    en DPFP.Verification.Verification.Verify(FeatureSet FeatureSet, Template Template, Result& Result) 
    en VerifyEnrollerApp.VerifyFinger.Process(Sample Sample) en c:\users\desarrollo 02\documents\visual studio 2012\Projects\VerifyEnrollerApp\VerifyEnrollerApp\Form1.vb:línea 322 
    en VerifyEnrollerApp.VerifyFinger.OnComplete(Object Capture, String ReaderSerialNumber, Sample Sample) en c:\users\desarrollo 02\documents\visual studio 2012\Projects\VerifyEnrollerApp\VerifyEnrollerApp\Form1.vb:línea 246 
    en DPFP.Capture.Capture.MessageReceived(Message& m) 
    --- Fin del seguimiento de la pila de la excepción interna --- 
    en DPFP.Capture.Capture.MessageReceived(Message& m) 
    en DPFP.Capture.Capture.MessageEvents.MessageWindow.WndProc(Message& m) 


************** Ensamblados cargados ************** 
mscorlib 
    Versión del ensamblado: 4.0.0.0 
    Versión Win32: 4.6.1087.0 built by: NETFXREL4STAGE 
    Código base: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll 
---------------------------------------- 
Microsoft.VisualStudio.HostingProcess.Utilities 
    Versión del ensamblado: 11.0.0.0 
    Versión Win32: 11.0.50727.1 
    Código base: file:///C:/Windows/assembly/GAC_MSIL/Microsoft.VisualStudio.HostingProcess.Utilities/11.0.0.0__b03f5f7f11d50a3a/Microsoft.VisualStudio.HostingProcess.Utilities.dll 
---------------------------------------- 
System.Windows.Forms 
    Versión del ensamblado: 4.0.0.0 
    Versión Win32: 4.6.1087.0 built by: NETFXREL4STAGE 
    Código base: file:///C:/Windows/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll 
---------------------------------------- 

Выберите в базу данных

Private Template As DPFP.Template 
Public Function CargarHuella() 
     Dim conexion As New SqlConnection(Cadena_Conexion) 
     Dim a As Byte() 
     Dim Result As String = "" 
     Dim sql As String 
     Try 

      conexion.Open() 
      sql = "SELECT H_1 FROM HUELLAS WHERE H_Nit_ID = '11' AND H_TypeDocument_ID = '1' AND H_Document_ID = '1032494911'" 

     Dim cmd As New SqlCommand(sql, conexion) 

     Dim reader As SqlDataReader = cmd.ExecuteReader() 

     If reader.Read Then 
      a = reader.GetValue(0) 
     End If 
      reader.Close() 
      cmd.Dispose() 
      conexion.Dispose() 

      Dim str As New MemoryStream 
      str = New MemoryStream(a) 'Convertirmos los bites en Memory 

      Dim template As New DPFP.Template(str) 'Volvemos el Memory en Template para verificar 

      CargarTemplate(template) 

      Result = "Exito" 
     Catch ex As Exception 
      Result = "Error: " & ex.ToString 
     End Try 

     Return Result 
    End Function 

Protected Sub CargarTemplate(ByVal template As DPFP.Template) 
     If Me.TXTMensajes.InvokeRequired Then 
      Dim d As New AddTemplateCallBack(AddressOf CargarTemplate) 
      Me.Invoke(d, New Object() {template}) 
     Else 
      Me.Template = template 
     End If 
    End Sub 

Проверочный Process

Private Verificator As DPFP.Verification.Verification  
Protected Sub ProcessSample(ByVal Sample As DPFP.Sample) 
      DibujarMapa(Sample) 

      Dim caracteristicas As DPFP.FeatureSet = ExtraerCaracteristicas(Sample, DPFP.Processing.DataPurpose.Enrollment) 

      If (Not caracteristicas Is Nothing) Then 
       ' Comparamos las caracteristicas de la huella tomada con las del template que tenemos 
       Dim result As DPFP.Verification.Verification.Result = New DPFP.Verification.Verification.Result() 
       Verificator.Verify(caracteristicas, Template, result) '<----HERE IS WHERE THE EXCEPTION IS SHOW 
       If result.Verified Then 
        SendMensaje("Ok", "Ok", 3) 
       Else 
        SendMensaje("KO", "KO", 1) 
       End If 
      End If 
     End Sub 

Что может быть неудачным, или что я терпеть неудачу?

PD:. Извините за мой плохой английский :(

ответ

0

РЕШЕНИЕ

Хорошо, я решил его следующим образом, я объясню это первый

Видимо я должен был создать в качестве нового объекта объекты, которые были извлечены, я просканировал с помощью try-catch, чтобы получить код ошибки, выданный SDK, в неудавшемся процессе, ошибка равна -29, а в документации объясняется, что это n есть ошибка в функциях и не может быть правильно преобразована. Я оставляю код с исправлением, он отлично работает для меня.

''' <summary> 
''' Todo el proceso que se encarga de validar la captura de la huella 
''' </summary> 
''' <param name="Sample"></param> 
''' <remarks></remarks> 
Protected Sub ProcessSample(ByVal Sample As DPFP.Sample) 
    Try 
     DibujarMapa(Sample) 

     Dim caracteristicas As DPFP.FeatureSet = New DPFP.FeatureSet '<---- I added this line and ready, it was fixed 
     caracteristicas = ExtraerCaracteristicas(Sample, DPFP.Processing.DataPurpose.Verification) 

     If (Not caracteristicas Is Nothing) Then 
      ' Comparamos las caracteristicas de la huella tomada con las del template que tenemos 
      Dim result As DPFP.Verification.Verification.Result = New DPFP.Verification.Verification.Result() 
      CodesErrors.GetTypeCode() 
      Verificator.Verify(caracteristicas, Template, result) 
      If result.Verified Then 
       Huella = True 
       UpdateCalidad("Mensaje: " & vbCrLf & vbCrLf & "Huella verificada") 
       SendMensaje("Ok", "Ok...", 3) 
      Else 
       Huella = False 
       UpdateCalidad("Mensaje: " & vbCrLf & vbCrLf & "Huella no coincide") 
       SendMensaje("KO", "KO...", 1) 
      End If 
     End If 
    Catch ex As Exception 
     If ex.HResult = -29 Then '<-- This is the error code from de SDK exception 
      SendMensaje("Lo sentimos, ocurrió un error durante la validación de la huella." & vbCrLf & vbCrLf & "• Message: 'Invalid Feature Set Type'" & vbCrLf & "• Exception Code: " & ex.HResult, "Disculpenos :(- Error Número (" & ex.HResult & ")", 1) 
     Else 
      SendMensaje("• Exception Message: " & ex.Message & vbCrLf & vbCrLf & "• Exception Code: " & ex.HResult, "Error al Verificar", 1) 
     End If 
    End Try 

End Sub