//Classe DigPersonaEnrollment / 18/08/2021 - 17:56
#Include "FiveWin.ch"
// DPFPEventHandlerStatusEnum
#Define df_EventHandlerStatusSuccess 0
#Define df_EventHandlerStatusFailure 1
// DPFPReaderSerialNumberTypeEnum
#Define df_ReaderSerialNumberTypePersistent 0
#Define df_ReaderSerialNumberTypeVolatile 1
// DPFPReaderImpressionTypeEnum
#Define df_ReaderImpressionTypeUnknown 0
#Define df_ReaderImpressionTypeSwipe 1
#Define df_ReaderImpressionTypeArea 2
// DPFPReaderTechnologyEnum
#Define df_ReaderTechnologyUnknown 0
#Define df_ReaderTechnologyOptical 1
#Define df_ReaderTechnologyCapacitive 2
#Define df_ReaderTechnologyThermal 3
#Define df_ReaderTechnologyPressure 4
// DPFPCapturePriorityEnum
#Define df_CapturePriorityLow 0
#Define df_CapturePriorityNormal 1
#Define df_CapturePriorityHigh 2
// DPFPCaptureFeedbackEnum
#Define df_CaptureFeedbackGood 0
#Define df_CaptureFeedbackNone 1
#Define df_CaptureFeedbackTooLight 2
#Define df_CaptureFeedbackTooDark 3
#Define df_CaptureFeedbackTooNoisy 4
#Define df_CaptureFeedbackLowContrast 5
#Define df_CaptureFeedbackNotEnoughFtrs 6
#Define df_CaptureFeedbackNoCentralRgn 7
#Define df_CaptureFeedbackNoFinger 8
#Define df_CaptureFeedbackTooHigh 9
#Define df_CaptureFeedbackTooLow 10
#Define df_CaptureFeedbackTooLeft 11
#Define df_CaptureFeedbackTooRight 12
#Define df_CaptureFeedbackTooStrange 13
#Define df_CaptureFeedbackTooFast 14
#Define df_CaptureFeedbackTooSkewed 15
#Define df_CaptureFeedbackTooShort 16
#Define df_CaptureFeedbackTooSlow 17
// DPFPTemplateStatusEnum
#Define df_TemplateStatusUnknown 0
#Define df_TemplateStatusInsufficient 1
#Define df_TemplateStatusCreationFailed 2
#Define df_TemplateStatusTemplateReady 3
// DPFPDataPurposeEnum
#Define df_DataPurposeUnknown 0
#Define df_DataPurposeVerification 1
#Define df_DataPurposeEnrollment 2
Class DigPersonaEnrollment
////////////////////////////////////////////////////////////////////////////////////////////////
// DigitalPersona Fingerprint Enrollment Control Activex Object
Data cCLSID_ActxEnrollmentControl INIT "DPFPActX.DPFPEnrollmentControl.1"
Data oActx391_EnrollmentControl
Data cCLSID_VerificationControl INIT "DPFPActX.DPFPVerificationControl.1"
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
// DPFPCtlXLib > DigitalPersona One Touch for Windows Control 1.0
// Fingerprint Enrollment Control Class
Data cCLSID_EnrollmentControl INIT "{0B4409EF-FD2B-4680-9519-D18C528B265E}" // Or "DPFPActX.DPFPEnrollmentControl.1"
Data oEnrollmentControl
// Gets the maximum number of fingers that can be enrolled.
// function Get_MaxEnrollFingerCount: LongInt
// Gets the maximum number of fingers that can be enrolled.
// procedure Set_MaxEnrollFingerCount(const Param1: LongInt)
// Gets the mask representing the user’s enrolled fingers.
// function Get_EnrolledFingersMask: LongInt
// Gets the mask representing the user’s enrolled fingers.
// procedure Set_EnrolledFingersMask(const Param1: LongInt)
// Gets the serial number of a fingerprint reader that captures a fingerprint sample.
// function Get_ReaderSerialNumber: WideString
// Gets the serial number of a fingerprint reader that captures a fingerprint sample.
// procedure Set_ReaderSerialNumber(const Param1: WideString)
// EVENTS
// Fires when a user deletes a finger.
// procedure OnDelete(const lFingerMask: LongInt; const pStatus: IDispatch): HRESULT
// Fires when a user enrolls a finger.
// procedure OnEnroll(const lFingerMask: LongInt; const pTemplate: IDispatch; const pStatus: IDispatch): HRESULT
// Fires when a user touches a fingerprint reader
// procedure OnFingerTouch(const pSerialNumber: WideString; const lEnrolledFinger: LongInt): HRESULT
// Fires when a user removes a finger from a fingerprint reader
// procedure OnFingerRemove(const pSerialNumber: WideString; const lEnrolledFinger: LongInt): HRESULT
// Fired on a successful scan
// procedure OnComplete(const pSerialNumber: WideString; const lEnrolledFinger: LongInt): HRESULT
// Fired when a reader is connected
// procedure OnReaderConnect(const pSerialNumber: WideString; const lEnrolledFinger: LongInt): HRESULT
// Fired when a reader is disconnected
// procedure OnReaderDisconnect(const pSerialNumber: WideString; const lEnrolledFinger: LongInt): HRESULT
// Fired when a fingerprint sample is received
// procedure OnSampleQuality(const pSerialNumber: WideString; const lEnrolledFinger: LongInt; const lSampleQuality: LongInt): HRESULT
// Fires when enrollment has begun
// procedure OnStartEnroll(const pSerialNumber: WideString; const lEnrolledFinger: LongInt): HRESULT
// Fires when enrollment is cancelled
// procedure OnCancelEnroll(const pSerialNumber: WideString; const lEnrolledFinger: LongInt): HRESULT
//--------------------------------------------------------------------------------------------//
// Fingerprint Verification Control Class
Data cCLSID_VerificationControl INIT "{F4AD5526-3497-4B8C-873A-A108EA777493}"
Data oVerificationControl
// Gets the serial number of a fingerprint reader that captures a fingerprint sample.
// function Get_ReaderSerialNumber: WideString
// Gets the serial number of a fingerprint reader that captures a fingerprint sample.
// procedure Set_ReaderSerialNumber(const Param1: WideString)
// Returns fingerprint capture state
// function Get_Active: WordBool
// Returns fingerprint capture state
// procedure Set_Active(const Param1: WordBool)
//--------------------------------------------------------------------------------------------//
// Event Handler Status Class
Data cCLSID_EventHandlerStatus INIT "{9D370792-0515-4E12-B791-5C6DF130CEC5}"
Data oEventHandlerStatus
// Gets the status of an operation.
// function Get_Status: DPFPEventHandlerStatusEnum
// Gets the status of an operation.
// procedure Set_Status(const Param1: DPFPEventHandlerStatusEnum)
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
// DPFPDevXLib > DigitalPersona One Touch for Windows Device components 1.0
// Sample Converter Class
Data cCLSID_SampleConversion INIT "{F6CEDB0E-A5F3-4C9C-BDB0-58B2BC9A4BF3}"
Data oSampleConversion
// Converts a fingerprint sample to an IPicture object.
// function ConvertToPicture(const pSample: IDispatch): IDispatch
// Converts a fingerprint sample to an image in ANSI 381 format.
// function ConvertToANSI381(const pSample: IDispatch): Variant
//--------------------------------------------------------------------------------------------//
// Fingerprint Sample Capture Class
Data cCLSID_Capture INIT "{3FA859DA-300C-4247-BD33-6011198399C0}"
Data oCapture
// Begins capturing a fingerprint sample from a fingerprint reader.
// procedure StartCapture
// Stops a fingerprint sample capture operation.
// procedure StopCapture
// Gets the serial number of a fingerprint reader that captures a fingerprint sample.
// function Get_ReaderSerialNumber: WideString
// Gets the serial number of a fingerprint reader that captures a fingerprint sample.
// procedure Set_ReaderSerialNumber(const Param1: WideString); dispid 3;
// Gets the priority of a fingerprint sample capture operation.
// function Get_Priority: DPFPCapturePriorityEnum; dispid 4;
// Gets the priority of a fingerprint sample capture operation.
// procedure Set_Priority(const Param1: DPFPCapturePriorityEnum)
//--------------------------------------------------------------------------------------------//
// Fingerprint Reader Description Class
Data cCLSID_ReaderDescription INIT "{0A611435-B092-45C7-B928-137255359B7A}"
Data oReaderDescription
// Gets the fingerprint reader serial number.
// function Get_SerialNumber: WideString
// Gets the fingerprint reader serial number type.
// function Get_SerialNumberType: DPFPReaderSerialNumberTypeEnum
// Gets the fingerprint reader impression type.
// function Get_ImpressionType: DPFPReaderImpressionTypeEnum
// Gets the fingerprint reader technology.
// function Get_Technology: DPFPReaderTechnologyEnum
// Gets the fingerprint reader language.
// function Get_LanguageID: LongInt
// Gets the fingerprint reader vendor name.
// function Get_Vendor: WideString
// Gets the fingerprint reader product name.
// function Get_ProductName: WideString
// pGets the fingerprint reader hardware revision number.
// function Get_HardwareRevision: WideString
// Gets the reader firmware revision number.
// function Get_FirmwareRevision: WideString
//--------------------------------------------------------------------------------------------//
// Fingerprint Readers Manager Class
Data cCLSID_ReadersCollection INIT "{2BF17AC6-58B6-4AF2-82A3-1DD4C4F99CE2}"
Data oReadersCollection
// Gets the total number of fingerprint readers connected to a system.
// function Get_Count: LongInt
// Creates an instance of DPFPReaderDescription for a particular fingerprint reader using its serial number.
// function Reader(const ReaderSerialNumber: WideString): IDispatch
// Gets a DPFPReaderDescription object from the readers connected to a system using its index.
// function Get_Item(const lDevice: LongInt): IDispatch
// Gets a pointer to an array of DPFPReaderDescription objects.
// function Get__NewEnum: IUnknown
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
// DPFPEngXLib > DigitalPersona One Touch for Windows Engine components 1.0
// Fingerprint Feature Set Creator Class
Data cCLSID_FeatureExtraction INIT "{C64055AD-8960-4429-BDB4-2E102F47BD9A}"
Data oFeatureExtraction
// Creates a fingerprint feature set for a specified purpose.
// function CreateFeatureSet(const pSample: IDispatch; const Purpose: DPFPDataPurposeEnum):DPFPCaptureFeedbackEnum
// Gets a DPFPFeatureSet object created during a fingerprint feature extraction operation.
// function Get_FeatureSet: IDispatch
//--------------------------------------------------------------------------------------------//
// Fingerprint Template Creator Class
Data cCLSID_Enrollment INIT "{1E1020EF-4A4F-430D-A351-427821B177B2}"
Data oEnrollment
// Gets the number of fingerprint feature sets still needed to create a fingerprint template.
// function Get_FeaturesNeeded: LongInt
// Gets the status of a fingerprint template creation operation.
// function Get_TemplateStatus: DPFPTemplateStatusEnum
// Gets a DPFPTemplate object created during an enrollment operation.
// function Get_Template: IDispatch
// Adds fingerprint feature sets, one-by-one, to a fingerprint template.
// procedure AddFeatures(const pFeatures: IDispatch)
//--------------------------------------------------------------------------------------------//
// Fingerprint Verification Class
Data cCLSID_Verification INIT "{8B7A9D29-5C11-464F-A058-BFA8024805CE}"
Data oVerification
// Gets the requested false accept rate (FAR).
// function Get_FARRequested: LongInt
// Gets the requested false accept rate (FAR).
// procedure Set_FARRequested(const Param1: LongInt)
// Performs the system function of fingerprint verification and returns a comparison decision.
// function Verify(const pFeatureSet: IDispatch; const pTemplate: IDispatch): IDispatch
//--------------------------------------------------------------------------------------------//
// Fingerprint Verification Result Class
Data cCLSID_VerificationResult INIT "{B2D559AE-F070-4C2A-9D99-6E68DA0B1E8E}"
Data oVerificationResult
// Gets a comparison decision.
// function Get_Verified: WordBool; dispid 1;
// Gets the achieved FAR for a comparison operation.
// function Get_FARAchieved: LongInt
////////////////////////////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////////////////////
// DPFPShrXLib > DigitalPersona One Touch for Windows Shared components 1.0
// Fingerprint Feature Set Class
Data cCLSID_FeatureSet INIT "{A93BFBD6-93A0-4DBD-92F8-0D2DD80F0824}"
Data oFeatureSet
// Serializes a fingerprint data object.
// function Serialize: Variant
// Deserializes a serialized fingerprint data object.
// procedure Deserialize(const RawData: Variant)
//--------------------------------------------------------------------------------------------//
// Fingerprint Sample Class
Data cCLSID_Sample INIT "{D005543B-EA11-499D-B3EA-37266D74BE79}"
Data oSample
// Serializes a fingerprint data object.
// function Serialize: Variant
// Deserializes a serialized fingerprint data object.
// procedure Deserialize(const RawData: Variant)
//--------------------------------------------------------------------------------------------//
// Fingerprint Template Class
Data cCLSID_Template INIT "{3926DADA-23CD-42BD-818E-2AAA37522307}"
Data oTemplate
// Serializes a fingerprint data object.
// function Serialize: Variant
// Deserializes a serialized fingerprint data object.
// procedure Deserialize(const RawData: Variant)
/* Gets the maximum number of fingers that can be enrolled. */
Data nMaxEnrollFingerCount AS NUMERIC INIT 10
/* Gets the mask representing the user’s enrolled fingers. */
Data nEnrolledFingersMask AS NUMERIC INIT 0
/* Gets the serial number of a fingerprint reader that captures a fingerprint sample. */
Data cReaderSerialNumber AS CHARACTER INIT "{00000000-0000-0000-0000-000000000000}"
Data cCLSID_EventHandlerStatus INIT "{9D370792-0515-4E12-B791-5C6DF130CEC5}"
Data oIDPFPEventHandlerStatus
Data cErrorTxtReturn // Txt error: Method Name + catch oError
Data lActivexInstaled // Drivers Digital Persona Instaled
Data lErrorCatch // if you have catch errors
Data lSaveLogs // If true, write logs to cFileLogs (Default .F. )
Data cFileLogs // file with event logs
Data oWndEnrollment, oDlgEnrollment
Data oTst
Method New() Constructor
Method End()
Method DigPersonaEnrollment_Start(f_lUiSuport)
Method DigPersonaEnrollment_Event(f_uEvent, f_aParams, f_pParams)
Method DigPersonaEnrollment_OnComplete(f_cReaderSerNum)
Method DigPersonaEnrollment_DPFPCtlXLib_Control_Build() // Build Class in DPFPCtlX.dll
Method DigPersonaEnrollment_DPFPDevXLib_Device_Build() // Build Class in DPFPDevX.dll
Method DigPersonaEnrollment_DPFPEngXLib_Engine_Build() // Build Class in DPFPEngX.dll
Method DigPersonaEnrollment_DPFPShrXLib_Shared_Build() // Build Class in DPFPShrX.dll
Method DigPersonaEnrollment_UiSuport()
Method DigPersonaEnrollment_Confirmar()
Method DigPersonaEnrollment_Capture()
EndClass
//-----------------------------------------------------------------------------
Method New() Class DigPersonaEnrollment
::cErrorTxtReturn := ""
::lErrorCatch := .F.
::lActivexInstaled := .F.
::lSaveLogs := .T.
::cFileLogs := DIR_TEMP()+"_DigPerEnrollment.txt"
if hb_FileExists(::cFileLogs)
FErase(::cFileLogs)
EndIf
Return Self
//-----------------------------------------------------------------------------
Method End() Class DigPersonaEnrollment
Return Nil
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_Start(f_lUiSuport) Class DigPersonaEnrollment
Local lc_oError
Local lc_oSelf := Hb_qSelf()
Default f_lUiSuport := .F.
/*
If !isActiveX(::cCLSID_ActxEnrollmentControl)
::cErrorTxtReturn := "Digital Persona Drivers Not Found"
Return .F.
else
::lActivexInstaled := .T.
EndIf
*/
//If !f_lUiSuport
If !::DigPersonaEnrollment_DPFPCtlXLib_Control_Build()
Return .F.
EndIf
//EndIf
If !::DigPersonaEnrollment_DPFPDevXLib_Device_Build()
Return .F.
EndIf
If !::DigPersonaEnrollment_DPFPEngXLib_Engine_Build()
Return .F.
EndIf
If !::DigPersonaEnrollment_DPFPShrXLib_Shared_Build()
Return .F.
EndIf
//::oCapture:StartCapture()
//If f_lUiSuport
::DigPersonaEnrollment_UiSuport()
//ENdIf
//::DigPersonaEnrollment_Capture()
//::oCapture:StartCapture()
//? "dsc"
Return .T.
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_Event(f_uEvent, f_aParams, f_pParams,f_tst) Class DigPersonaEnrollment
Local lc_cMsg := "", lc_cEventTarget := ""
Local lc_iFor := 0, lc_aTmp := {0,0}
Local lc_hWnd, lc_nParamsCount := 0
lc_cEventTarget := cValToChar( f_uEvent )
lc_cMsg := "Event: " + lc_cEventTarget + " > Type: " + ValType(f_uEvent) +CRLF
lc_cMsg += "Params: " + CRLF
For lc_iFor := 1 to Len( f_aParams )
lc_cMsg += cValToChar( f_aParams[ lc_iFor ] ) + " > Type: "+ValType(f_aParams[ lc_iFor ])+ CRLF
lc_nParamsCount ++
next
lc_cMsg += "pParams"+CRLF
For lc_iFor := 1 to Len( f_pParams )
lc_cMsg += cValToChar( f_pParams[ lc_iFor ] ) + " > Type: "+ValType(f_pParams[ lc_iFor ] )+ CRLF
lc_nParamsCount ++
next
//SetEventParam( f_pParams, 7, .t. ) // Comment this to allow navigation
//logfile(::cFileLogs,f_pParams)
If Upper(lc_cEventTarget) == "ONCOMPLETE"
//? ValType(f_aParams[1])
//? ValType(f_uEvent)
//xBrowse(f_pParams)
::DigPersonaEnrollment_OnComplete(f_aParams[1])
//::oActx391_EnrollmentControl:OnComplete(f_aParams[1])
EndIf
If Upper(lc_cEventTarget) == "ONENROLL"
//? ValType(f_aParams[1])
//? ValType(f_uEvent)
//xBrowse(f_aParams[3])
OBJECT_EXPLORER(f_aParams[3])
//::DigPersonaEnrollment_OnComplete(f_aParams[1])
//::oActx391_EnrollmentControl:OnComplete(f_aParams[1])
EndIf
If ::lSaveLogs
logfile(::cFileLogs,lc_cMsg,.F.)
EndIf
Return Nil
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_OnComplete(f_cReaderSerNum) Class DigPersonaEnrollment
Local lc_oSelf := Hb_qSelf()
Local lc_oBmp
locaL Lc_otst
//OBJECT_EXPLORER(f_cReaderSerNum)
//Define Bitmap lc_oBmp
//lc_obmp := CreateCompatibleBitmap(GetDC( GetDesktopWindow()),200,200)
///::oEnrollmentControl:OnComplete(f_cReaderSerNum,@Lc_otst)
///Lc_otst := Win_OleCreateObject(::cCLSID_SampleConversion)
//syswait(4)
//::oSample:Serialize()
//Lc_otst:Serialize()
///? ::oSampleConversion:ConvertToPicture(::oSample)
//xBrowse(::oSample)
//OBJECT_EXPLORER(::oActx391_EnrollmentControl:DPFPCapture)
//xBrowse(::oActx391_EnrollmentControl)
//xBrowse(::oIDPFPEventHandlerStatus:Status())
//xBrowse(::oActx391_EnrollmentControl:EnrolledFingersMask)
Return nil
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_DPFPCtlXLib_Control_Build() Class DigPersonaEnrollment
Local lc_oError
Try
::oEventHandlerStatus := Win_OleCreateObject(::cCLSID_EventHandlerStatus)
catch lc_oError
::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPCtlXLib_Control_Build"+CRLF
::cErrorTxtReturn := "Instance IDPFPEventHandlerStatus"+CRLF
::cErrorTxtReturn += "Error: " + Transform(lc_oError:GenCode, nil) + CRLF +;
"SubC: " + Transform(lc_oError:SubCode, nil) + CRLF +;
"OSCode: " + Transform(lc_oError:OsCode, nil) + CRLF +;
"SubSystem: " + Transform(lc_oError:SubSystem, nil) + CRLF +;
"Mensagem: " + lc_oError:Description
::lErrorCatch := .T.
End Try
If ::lErrorCatch
Return .F.
EndIf
//OBJECT_EXPLORER(::oEventHandlerStatus, "IDPFPEventHandlerStatus")
Try
::oVerificationControl := Win_OleCreateObject(::cCLSID_VerificationControl)
catch lc_oError
::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPCtlXLib_Control_Build"+CRLF
::cErrorTxtReturn := "Instance IDPFPVerificationControl"+CRLF
::cErrorTxtReturn += "Error: " + Transform(lc_oError:GenCode, nil) + CRLF +;
"SubC: " + Transform(lc_oError:SubCode, nil) + CRLF +;
"OSCode: " + Transform(lc_oError:OsCode, nil) + CRLF +;
"SubSystem: " + Transform(lc_oError:SubSystem, nil) + CRLF +;
"Mensagem: " + lc_oError:Description
::lErrorCatch := .T.
End Try
If ::lErrorCatch
Return .F.
EndIf
//OBJECT_EXPLORER(::oVerificationControl, "IDPFPVerificationControl")
Try
::oEnrollmentControl := Win_OleCreateObject(::cCLSID_EnrollmentControl)
catch lc_oError
::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPCtlXLib_Control_Build"+CRLF
::cErrorTxtReturn := "Instance IDPFPEnrollmentControl"+CRLF
::cErrorTxtReturn += "Error: " + Transform(lc_oError:GenCode, nil) + CRLF +;
"SubC: " + Transform(lc_oError:SubCode, nil) + CRLF +;
"OSCode: " + Transform(lc_oError:OsCode, nil) + CRLF +;
"SubSystem: " + Transform(lc_oError:SubSystem, nil) + CRLF +;
"Mensagem: " + lc_oError:Description
::lErrorCatch := .T.
End Try
If ::lErrorCatch
Return .F.
EndIf
//OBJECT_EXPLORER(::oEnrollmentControl, "IDPFPEnrollmentControl")
Return .T.
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_DPFPDevXLib_Device_Build() Class DigPersonaEnrollment
Local lc_oError
Try
::oReaderDescription := Win_OleCreateObject(::cCLSID_ReaderDescription)
catch lc_oError
::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPDevXLib_Device_Build"+CRLF
::cErrorTxtReturn := "Instance IDPFPReaderDescription"+CRLF
::cErrorTxtReturn += "Error: " + Transform(lc_oError:GenCode, nil) + CRLF +;
"SubC: " + Transform(lc_oError:SubCode, nil) + CRLF +;
"OSCode: " + Transform(lc_oError:OsCode, nil) + CRLF +;
"SubSystem: " + Transform(lc_oError:SubSystem, nil) + CRLF +;
"Mensagem: " + lc_oError:Description
::lErrorCatch := .T.
End Try
If ::lErrorCatch
Return .F.
EndIf
//OBJECT_EXPLORER(::oReaderDescription, "IDPFPReaderDescription")
Try
::oReadersCollection := Win_OleCreateObject(::cCLSID_ReadersCollection)
catch lc_oError
::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPDevXLib_Device_Build"+CRLF
::cErrorTxtReturn := "Instance cCLSID_ReadersCollection"+CRLF
::cErrorTxtReturn += "Error: " + Transform(lc_oError:GenCode, nil) + CRLF +;
"SubC: " + Transform(lc_oError:SubCode, nil) + CRLF +;
"OSCode: " + Transform(lc_oError:OsCode, nil) + CRLF +;
"SubSystem: " + Transform(lc_oError:SubSystem, nil) + CRLF +;
"Mensagem: " + lc_oError:Description
::lErrorCatch := .T.
End Try
If ::lErrorCatch
Return .F.
EndIf
//OBJECT_EXPLORER(::oReadersCollection, "cCLSID_ReadersCollection")
Try
::oCapture := Win_OleCreateObject(::cCLSID_Capture)
catch lc_oError
::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPDevXLib_Device_Build"+CRLF
::cErrorTxtReturn := "Instance IDPFPCaptureEvents"+CRLF
::cErrorTxtReturn += "Error: " + Transform(lc_oError:GenCode, nil) + CRLF +;
"SubC: " + Transform(lc_oError:SubCode, nil) + CRLF +;
"OSCode: " + Transform(lc_oError:OsCode, nil) + CRLF +;
"SubSystem: " + Transform(lc_oError:SubSystem, nil) + CRLF +;
"Mensagem: " + lc_oError:Description
::lErrorCatch := .T.
End Try
If ::lErrorCatch
Return .F.
EndIf
//OBJECT_EXPLORER(::oCapture, "IDPFPCaptureEvents")
::oCapture:__hSink := __axRegisterHandler( ::oCapture:__hObj, {| _Par01,_Par02,_Par03,_Par04 | logfile(::cFileLogs,{_Par01,_Par02,_Par03,_Par04},.F.) } )
Try
::oSampleConversion := Win_OleCreateObject(::cCLSID_SampleConversion)
catch lc_oError
::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPDevXLib_Device_Build"+CRLF
::cErrorTxtReturn := "Instance IDPFPSampleConversion"+CRLF
::cErrorTxtReturn += "Error: " + Transform(lc_oError:GenCode, nil) + CRLF +;
"SubC: " + Transform(lc_oError:SubCode, nil) + CRLF +;
"OSCode: " + Transform(lc_oError:OsCode, nil) + CRLF +;
"SubSystem: " + Transform(lc_oError:SubSystem, nil) + CRLF +;
"Mensagem: " + lc_oError:Description
::lErrorCatch := .T.
End Try
If ::lErrorCatch
Return .F.
EndIf
//OBJECT_EXPLORER(::oSampleConversion, "IDPFPSampleConversion")
Return .T.
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_DPFPEngXLib_Engine_Build() Class DigPersonaEnrollment
Local lc_oError
Try
::oFeatureExtraction := Win_OleCreateObject(::cCLSID_FeatureExtraction)
catch lc_oError
::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPEngXLib_Engine_Build"+CRLF
::cErrorTxtReturn := "Instance IDPFPFeatureExtraction"+CRLF
::cErrorTxtReturn += "Error: " + Transform(lc_oError:GenCode, nil) + CRLF +;
"SubC: " + Transform(lc_oError:SubCode, nil) + CRLF +;
"OSCode: " + Transform(lc_oError:OsCode, nil) + CRLF +;
"SubSystem: " + Transform(lc_oError:SubSystem, nil) + CRLF +;
"Mensagem: " + lc_oError:Description
::lErrorCatch := .T.
End Try
If ::lErrorCatch
Return .F.
EndIf
//OBJECT_EXPLORER(::oFeatureExtraction, "IDPFPFeatureExtraction")
Try
::oEnrollment := Win_OleCreateObject(::cCLSID_Enrollment)
catch lc_oError
::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPEngXLib_Engine_Build"+CRLF
::cErrorTxtReturn := "Instance IDPFPEnrollment"+CRLF
::cErrorTxtReturn += "Error: " + Transform(lc_oError:GenCode, nil) + CRLF +;
"SubC: " + Transform(lc_oError:SubCode, nil) + CRLF +;
"OSCode: " + Transform(lc_oError:OsCode, nil) + CRLF +;
"SubSystem: " + Transform(lc_oError:SubSystem, nil) + CRLF +;
"Mensagem: " + lc_oError:Description
::lErrorCatch := .T.
End Try
If ::lErrorCatch
Return .F.
EndIf
//OBJECT_EXPLORER(::oEnrollment, "IDPFPEnrollment")
Try
::oVerification := Win_OleCreateObject(::cCLSID_Verification)
catch lc_oError
::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPEngXLib_Engine_Build"+CRLF
::cErrorTxtReturn := "Instance IDPFPVerification"+CRLF
::cErrorTxtReturn += "Error: " + Transform(lc_oError:GenCode, nil) + CRLF +;
"SubC: " + Transform(lc_oError:SubCode, nil) + CRLF +;
"OSCode: " + Transform(lc_oError:OsCode, nil) + CRLF +;
"SubSystem: " + Transform(lc_oError:SubSystem, nil) + CRLF +;
"Mensagem: " + lc_oError:Description
::lErrorCatch := .T.
End Try
If ::lErrorCatch
Return .F.
EndIf
//OBJECT_EXPLORER(::oVerification, "IDPFPVerification")
Try
::oVerificationResult := Win_OleCreateObject(::cCLSID_VerificationResult)
catch lc_oError
::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPEngXLib_Engine_Build"+CRLF
::cErrorTxtReturn := "Instance IDPFPVerificationResult"+CRLF
::cErrorTxtReturn += "Error: " + Transform(lc_oError:GenCode, nil) + CRLF +;
"SubC: " + Transform(lc_oError:SubCode, nil) + CRLF +;
"OSCode: " + Transform(lc_oError:OsCode, nil) + CRLF +;
"SubSystem: " + Transform(lc_oError:SubSystem, nil) + CRLF +;
"Mensagem: " + lc_oError:Description
::lErrorCatch := .T.
End Try
If ::lErrorCatch
Return .F.
EndIf
//OBJECT_EXPLORER(::oVerificationResult, "IDPFPVerificationResult")
Return .T.
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_DPFPShrXLib_Shared_Build() Class DigPersonaEnrollment
Local lc_oError
Try
::oFeatureSet := Win_OleCreateObject(::cCLSID_FeatureSet)
catch lc_oError
::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPShrXLib_Shared_Build"+CRLF
::cErrorTxtReturn := "Instance IDPFPFeatureSet"+CRLF
::cErrorTxtReturn += "Error: " + Transform(lc_oError:GenCode, nil) + CRLF +;
"SubC: " + Transform(lc_oError:SubCode, nil) + CRLF +;
"OSCode: " + Transform(lc_oError:OsCode, nil) + CRLF +;
"SubSystem: " + Transform(lc_oError:SubSystem, nil) + CRLF +;
"Mensagem: " + lc_oError:Description
::lErrorCatch := .T.
End Try
If ::lErrorCatch
Return .F.
EndIf
//OBJECT_EXPLORER(::oFeatureSet, "IDPFPFeatureSet")
Try
::oSample := Win_OleCreateObject(::cCLSID_Sample)
catch lc_oError
::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPShrXLib_Shared_Build"+CRLF
::cErrorTxtReturn := "Instance IDPFPSample"+CRLF
::cErrorTxtReturn += "Error: " + Transform(lc_oError:GenCode, nil) + CRLF +;
"SubC: " + Transform(lc_oError:SubCode, nil) + CRLF +;
"OSCode: " + Transform(lc_oError:OsCode, nil) + CRLF +;
"SubSystem: " + Transform(lc_oError:SubSystem, nil) + CRLF +;
"Mensagem: " + lc_oError:Description
::lErrorCatch := .T.
End Try
If ::lErrorCatch
Return .F.
EndIf
//OBJECT_EXPLORER(::oSample, "IDPFPSample")
Try
::oTemplate := Win_OleCreateObject(::cCLSID_Template)
catch lc_oError
::cErrorTxtReturn := "Method DigPersonaEnrollment_DPFPShrXLib_Shared_Build"+CRLF
::cErrorTxtReturn := "Instance IDPFPTemplate"+CRLF
::cErrorTxtReturn += "Error: " + Transform(lc_oError:GenCode, nil) + CRLF +;
"SubC: " + Transform(lc_oError:SubCode, nil) + CRLF +;
"OSCode: " + Transform(lc_oError:OsCode, nil) + CRLF +;
"SubSystem: " + Transform(lc_oError:SubSystem, nil) + CRLF +;
"Mensagem: " + lc_oError:Description
::lErrorCatch := .T.
End Try
If ::lErrorCatch
Return .F.
EndIf
//OBJECT_EXPLORER(::oTemplate, "IDPFPTemplate")
Return .T.
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_UiSuport() Class DigPersonaEnrollment
Local lc_oSelf := Hb_qSelf()
Local lc_oBtn351_Confirmar
Local Enroll
DEFINE WINDOW ::oWndEnrollment from 0,0 to 484,520 TITLE "Capturar Digital" PIXEL
/*
DEFINE Dialog ::oDlgEnrollment Resource "ENROLLMENT2" //OF ::oWndEnrollment
::oDlgEnrollment:lTransparent := .F.
//::oDlgEnrollment:nStyle := nOR(WS_CHILD,WS_CLIPCHILDREN)
::oActx391_EnrollmentControl := TActiveX():Redefine(391,lc_oSelf:oDlgEnrollment,::cCLSID_ActxEnrollmentControl)
//::oActx391_EnrollmentControl := THActiveX():New(lc_oSelf:oWndEnrollment,::cCLSID_ActxEnrollmentControl,0,0,500,420)
//::oActx391_EnrollmentControl := TActiveX():Redefine(391,lc_oSelf:oDlgEnrollment,::cCLSID_ActxEnrollmentControl)
::oDlgEnrollment:bInit := <||
::oActx391_EnrollmentControl:bOnEvent := { | f_event, f_aParams, f_pParams | lc_oSelf:DigPersonaEnrollment_Event( f_event, f_aParams, f_pParams ) }
Return Nil
>//cEnd
ACTIVATE Dialog ::oDlgEnrollment CENTERED //NOMODAL
*/
@ 440, 100 ButtonBmp Enroll ;
size 120,60 Of ::oWndEnrollment BitMap Res_BmpName("CONFIRMAR") ;
Prompt "Confirmar" PIXEL ;
TEXTRIGHT ;
ToolTip "Confirma a Captura das digitais e finaliza"
Enroll:bAction := <||
Local _uVar := 0
::DigPersonaEnrollment_Confirmar()
Return Nil
> //cEnd
::oWndEnrollment:bInit := <||
//::oDlgEnrollment:Move(0,0)
::oActx391_EnrollmentControl := THActiveX():New(lc_oSelf:oWndEnrollment,::cCLSID_ActxEnrollmentControl,0,0,500,420)
//::oActx391_EnrollmentControl := THActiveX():New(lc_oSelf:oWndEnrollment,::cCLSID_VerificationControl,0,0,500,420)
::oActx391_EnrollmentControl:bOnEvent := <| f_event, f_aParams, f_pParams, f_Tst01, f_Tst02, f_Tst03 |
lc_oSelf:DigPersonaEnrollment_Event( f_event, f_aParams, f_pParams)
If ValType(f_Tst01) != "U"
? "01 "+ValType(f_Tst01)
ElseIf ValType(f_Tst02) != "U"
? "02 "+ValType(f_Tst02)
ElseIf ValType(f_Tst03) != "U"
? "03 "+ValType(f_Tst03)
EndIf
Return Nil
> //cEnd
//__objAddMethod(lc_oSelf:oActx391_EnrollmentControl,"OnComplete",@MyOnComplete())
Return Nil
> //cEnd
ACTIVATE WINDOW ::oWndEnrollment NORMAL CENTERED
//hb_MemoWrit(DIR_TEMP()+"_EventDigitalPersona.txt")
//shellExecute(0,"open",DIR_TEMP()+"_EventDigitalPersona.txt")
Return Nil
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_Confirmar() Class DigPersonaEnrollment
? ::oFeatureExtraction:FeatureSet()
Return Nil
//-----------------------------------------------------------------------------
Method DigPersonaEnrollment_Capture() Class DigPersonaEnrollment
Local lc_oDlgCapture
Local lc_oBtn651_Capture
Local lc_oBmp
DEFINE DIALOG lc_oDlgCapture RESOURCE "DIGITAL_PERSONA_CAPTURE"
Redefine ButtonBmp lc_oBtn651_Capture ;
Id 651 Of lc_oDlgCapture BitMap "cBitmapRes";
Prompt "Capturar" ;
CANCEL ;
TEXTRIGHT ;
ToolTip "Teste"
lc_oBtn651_Capture:bAction := <||
Local _uVar := 1
::oCapture:StartCapture()
syswait(5)
Define Bitmap lc_oBmp
lc_obmp := CreateCompatibleBitmap(GetDC( GetDesktopWindow()),200,200)
::oSample:Serialize()
? ::oSampleConversion:ConvertToPicture(@::oSample,lc_oBmp)
::oCapture:StopCapture()
Return Nil
> //cEnd
ACTIVATE DIALOG lc_oDlgCapture CENTERED
Return Nil