activex - How to serialize DigitalPersona fingerprint template in Delphi -


i'm having big difficulty trying serialize digitalpersona fingerprint templates. don't know i'm doing wrong. i'm able deserialize template file saved demo exe distributed sdk , verify template without problems code in application

procedure tfmain.button4click(sender: tobject); var   blob: array [0 .. 1632] of byte;   varblob: olevariant;   myfile: file;   p: pointer;   teste: tdpfptemplate; begin   // read binary data file.   if opendialog1.execute   begin     assignfile(myfile, opendialog1.filename);     reset(myfile, 1632);     blockread(myfile, blob, 1);     closefile(myfile);     varblob := vararraycreate([0, length(blob) - 1], varbyte);     p := vararraylock(varblob);     try       move(blob[0], p^, length(blob));           vararrayunlock(varblob);     end;     if not assigned(template)     begin       teste := tdpfptemplate.create(self);       template := teste.defaultinterface;       template.deserialize(varblob);     end;   end; 

but when try serialize template save file in application, data being written in file seems have nothing template, because checked file contents , very, different in structure. i'm doing call serialize method of idpfptemplate interface it's told on sdk docs. but, when try verify fingerprint using file generated application fingerprint cannot verified because contents of file invalid. here code serialize , save file

procedure tfmain.button3click(sender: tobject); var   myfile: file;   oleblob: olevariant;   blob: array of byte;   ubound: integer; begin   {template global variable in main form set    enroll process, can verify template set enroll    process, i'm not able record , verify later.    serialize method returns olevariant containing array of    bytes}   oleblob := template.serialize;   if vararraydimcount(oleblob) = 1   begin     ubound := vararrayhighbound(oleblob, 1);   end;    if ubound < 0     showmessage('template vazio')   else   begin     blob := oleblob;     assignfile(myfile, 'c:\users\leandro\desktop\teste.txt');     rewrite(myfile, 1632);     blockwrite(myfile, blob, 1);     closefile(myfile);   end; end; 

note size of template 1632 bytes, that's why array 1632 bytes long. there wrong in way i'm recording array contents on file or call sdk's serialize method generate invalid template data file?


Comments

  1. Hello.
    Did you manage to solve the problem? It's happening to me now in VB6. With SDK 2.2.3 it cannot be serialized as in 1.6.1

    ReplyDelete

Post a Comment

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -