Creating digital persona fingerprint template from serialized data

回眸只為那壹抹淺笑 提交于 2019-12-03 21:07:35

I found a pdf document where the Deserialize method is feaded a byte array. Your FingerBuffer is a PAnsiChar, which is an array of bytes. But then you cast it to a string which is automatically converted to an OleString (Delphi converts a string to an OleString when you assign it to an OleVariant). So you don't have an array of bytes anymore.

What you can try to do (I won't garantee it :) ):

var
  lByteArray: Variant;
  lArrayPointer: Pointer;
  lStr: AnsiString;
  DPFPTemplate: TDPFPTemplate;
begin
  lStr := AUserFinREcPtr.FingerBuffer;
  lByteArray := VarArrayCreate([0, Length(lStr) - 1], varByte );
  lArrayPointer:= VarArrayLock(lByteArray);
  try
    Move( lStr[1], lArrayPointer^, Length(lStr) );
  finally
    VarArrayUnlock(lByteArray);
  end;
  DPFPTemplate := TDPFPTemplate.Create(nil);
  DPFPTemplate.DefaultInterface.Deserialize(lByteArray);
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!