 |
|
 |
cempaka Level: Big Cheese
 Registered: 03-03-2009 Posts: 19
|
fingerprint coding problem..
hi there..
i have a fingerprint project..
im using a fingerprint device with smart card..
i had connected the device..
i done the initialization, the connection, and formatting the smart card..
but my problem now is for the enrolling..
when i click "ENROLL", my VB hang..and then forcing me to exit the program...
this is my coding for enroll..
Private Sub cmdENROLL_Click()
Dim ppNewTemplateHLP As Long
Dim indx As Integer
Dim i As Integer
Dim lngTimeout As Long
' Payload Data buffer
Dim pPayloadBuffer() As Byte
Dim pPayload As PT_DATA
ShowCallBack True
' Get Payload data length
pPayload.Length = CLng(Len(txtPayloadDataPC.Text))
If pPayload.Length > 0 Then
ReDim pPayload.Data(pPayload.Length - 1)
For i = 1 To pPayload.Length
pPayload.Data(i - 1) = AscB(Mid(txtPayloadDataPC.Text, i, 1))
Next i
End If
ReDim pPayloadBuffer(4 + pPayload.Length)
CopyMemory pPayloadBuffer(0), VarPtr(pPayload.Length), 4
If pPayload.Length > 0 Then
CopyMemory pPayloadBuffer(4), VarPtr(pPayload.Data(0)), pPayload.Length
End If
lngTimeout = 20000 ' default at -1
lngResult = PTEnroll(phConnection, PT_PURPOSE_ENROLL, 0&, VarPtr(ppNewTemplate), 0&, pPayloadBuffer(0), lngTimeout, 0&, 0&, 0&)
ppNewTemplateHLP = ppNewTemplate
CopyMemory AppMemory.Header, ppNewTemplate, 16
ppNewTemplate = ppNewTemplateHLP
ReDim AppMemory.FullBIRData(AppMemory.Header.Lenght)
CopyMemory AppMemory.FullBIRData(0), ppNewTemplate, AppMemory.Header.Lenght
PTFree ppNewTemplateHLP
AppMeNr = AppMeNr + 1
DisplayResult "PTEnroll: " & lngResult
DisplayResult "Result String : " & GetErrorString(lngResult)
ShowCallBack False
End Sub
plz help me..
thanks.
one more thing, im using win vista..
is it not very compatible with VB?
|
|
02-04-2009 at 01:16 PM |
|
|
cempaka Level: Big Cheese
 Registered: 03-03-2009 Posts: 19
|
Re: fingerprint coding problem..
thanks to admin
i dont know is the problem..
because for the initialization and connection, it has no problem..
but when it comes to enroll, it hangs..
yup..im using the dll provided..
|
|
02-04-2009 at 01:59 PM |
|
|
admin Level: Administrator

 Registered: 04-04-2002 Posts: 601
|
Re: fingerprint coding problem..
hello,
why don't you try to debug it?
maybe you aren't used to VB debug features...let me try to explain:
you can place a breakpoint inside your code, maybe at the beginning of your routine and then go forward one istruction at a time.
so try this: place the cursor at the first instruction in your subroutine and press F9, you'll see a red dot at the left side of your code, this means that you have inserted a breakpoint.
Then run your code (F5), when you'll go into your enroll process and program execution reaches the breakpoint line, your program will stop and you'll be taken back to vb, then pressing Shift+F8, execuition will go forward one instruction, keep pressing Shift+F8 until in hangs, then you will know what is the instruction that is blocking your program.
If you want to continue with standard execution press F5 again...
hope it helps,
let me know if you got results
____________________________
AndreaVB
|
|
02-04-2009 at 02:31 PM |
|
|
cempaka Level: Big Cheese
 Registered: 03-03-2009 Posts: 19
|
Re: fingerprint coding problem..
thank admin..
i got it..
it hangs at this line
CopyMemory AppMemory.Header, ppNewTemplate, 16
ppNewTemplate = ppNewTemplateHLP
oh please help me...
what to do..
|
|
02-04-2009 at 03:59 PM |
|
|
cempaka Level: Big Cheese
 Registered: 03-03-2009 Posts: 19
|
Re: fingerprint coding problem..
i try to comment the line that make the app hangs..
but it result an error that "PerfectTrust API wasn't initialized"..
what do i have to do?
|
|
02-04-2009 at 04:16 PM |
|
|
cempaka Level: Big Cheese
 Registered: 03-03-2009 Posts: 19
|
Re: fingerprint coding problem..
ok..
after that line, the value that return is the same as the error that occur..
that is -1002..
if its ok, it should be 0..
what to do now?
im a newbie.
thanks admin..
|
|
02-04-2009 at 05:22 PM |
|
|
cempaka Level: Big Cheese
 Registered: 03-03-2009 Posts: 19
|
Re: fingerprint coding problem..
i dont think there are some trouble shooting guide..
like i said before, the error means that "PerfectTrust API wasn't initialized..
oh my god.
what to do.
time is running out..
i really need help.
|
|
03-04-2009 at 07:02 AM |
|
|
|
|
 |
 |