如何在 Delphi 中使用 DPFPVerification 类,因为即使已经导入 activeX 控件,它也会变成错误“未声明标识符”(DigitalPersona One Touch for Windows Control 1.0,它将安装类 TDPFPVerificationControl 和 TDPPFEnrollmentControl)
实际上这适用于 C++ 和 Visual Basic,但我需要使用 Delphi 7 来使用它。
步骤是:
- 安装一键式 DigitalPersona SDK,
- 从 Delphi 7 导入 ActiveX 控件
视觉基本代码:
// NOT ERROR, but error in Delphi ( var Ver:DPFPVerification; )
Dim Ver As DPFPVerification
Private Sub Form_Load()
' Create DPFPVerification object.
Set Ver = New DPFPVerification
End Sub
Private Sub DPFPVerificationControl1_OnComplete
(ByVal Ftrs As Object, ByVal Stat As Object)
Dim Res As Object
Dim Templ As Object
' Compare feature set with all stored templates.
For i = 0 To 10
' Get template from storage.
Set Templ = MainForm.GetTemplate(i)
If Templ Is Nothing Then
Else
' Compare feature set with particular template.
Set Res = Ver.Verify(Ftrs, Templ)
' If match, exit from loop.
If Res.Verified = True Then Exit For
End If
Next
If Res Is Nothing Then
Stat.Status = EventHandlerStatusFailure
Exit Sub
ElseIf Res.Verified = False Then
' If non-match, notify caller.
Stat.Status = EventHandlerStatusFailure
MainForm.Verified.Value = 0
Else
MainForm.Verified.Value = 1
End If
' Show false accept rate.
MainForm.FAR.Caption = Res.FARAchieved
End Sub
德尔福代码:
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, OleCtrls, DPFPCtlXLib_TLB;
var
frm_verification: Tfrm_verification;
Ver:DPFPVerification; << ERROR : 'undeclare identifier DPFPVerification'