在数字角色模板上运行指纹验证程序时,我一直收到以下错误。我现在在我的智慧结束。我的知识很短,我没有人可以求助。你能帮忙吗?
错误消息
Test17.exe raised EacessViolation with message;Access violation at address 004033B7E in module ‘Test17.exe’
DELPHI 5代码进行验证
procedure TFormVerify.DPFPVerificationControl1Complete(Sender: TObject;
const pFeatureSet, pStatus: IDispatch);
var
lStr, Str1,Str2 : AnsiString; //Deserialize method
lByteArray : Variant;
lArrayPointer : Pointer;
DPFPTemplate : TDPFPTemplate; //IDispatch;
MFar : Integer; //Long integer of result archieved
MVerified : Boolean; //Result of whether finger has been verified or not
MFeatureSet : Variant; //IDispatch, Variant;
MTemplate : Variant; //IDispatch, Variant;
MRes : Variant; //TDPFPVerificationResult;
oVerificationResult : DPFPVerificationResult;
begin
// Experiment
MFeatureSet := pFeatureSet; // Dispatch cast to Variant
MTemplate := Template; // Dispatch cast to Variant
Str1 := MfeatureSet.Serialize; // Note string shows
Str2 := Mtemplate.Serialize; // Note string shows
try
if (pFeatureSet=nil) or (Template=nil) then
MessageDlg('Empty Featureset or Template!', mtInformation,[mbOk], 0)
else
Res := Ver.Verify(pFeatureSet, Template); // ERROR MESSAGE
MRes := Res;
MVerified := MRes.Verified;
MFar := MRes.QueryInterface.FARAchieved; DPFPVerificationResult1.FARAchieved;
except
on E: Exception do MessageDlg(E.Message +' : ' + IntToStr(E.HelpContext), mtInformation,[mbOk], 0);
end;
答案 0 :(得分:0)
可能的原因:
(1)如果pFeatureSet或Template为nil,则hten Res将未定义,导致调用Res.Verified时出现异常
(2)MRes.QueryInterface为nil;
(3)DPFPVerificationResult1为零
答案 1 :(得分:0)
DPFPTemplate: DPFPFeatureSet; //IDispatch;
MFeatureSet := pFeatureSet as DPFPFeatureSet; // Dispatch cast to Variant