[progress Communities] [progress Openedge Abl] Forum Post: Re: How-to...

  • Thread starter Thread starter OctavioOlguin
  • Start date Start date
Status
Not open for further replies.
O

OctavioOlguin

Guest
Calrifiying information. 1) Got a Byte[] from a .NET call to a fingerprint reader. 2) used METHOD PUBLIC STATIC MEMPTR ByteArrayToMemptr (poBytes AS "System.Byte[]":U): DEFINE VARIABLE myMemptr AS MEMPTR NO-UNDO . DEFINE VARIABLE oIntPointer AS System.IntPtr NO-UNDO . SET-SIZE (myMemptr) = poBytes:Length . oIntPointer = NEW System.IntPtr (GET-POINTER-VALUE (myMemptr)). System.Runtime.InteropServices.Marshal:Copy (poBytes, 0, oIntPointer, poBytes:Length). RETURN myMemptr. FINALLY: DELETE OBJECT oIntPointer. END FINALLY. END METHOD . to get a value to be stored on ad BLOB field. 3) A day later, need to use another scanner function to verify match to a given fingerprint, with: Matcher:Verify(CurrentTemplate, currentTemplate_size, TemplateToMatch, TemplateSizeToMatch, OUTPUT bool1) So, the stored value is moved to a memptr again and then converted to a BYTE[] with: METHOD PUBLIC STATIC "System.Byte[]" MemptrToByteArray( pmptr AS MEMPTR ): DEFINE VARIABLE nPtr AS System.IntPtr NO-UNDO. DEFINE VARIABLE vInt AS INTEGER NO-UNDO. DEFINE VARIABLE nBytes AS "System.Byte[]". vInt = GET-SIZE(pmPtr). nBytes = NEW "System.Byte[]"(vInt). nPtr = NEW System.IntPtr(GET-POINTER-VALUE(pmPtr)). System.Runtime.InteropServices.Marshal:Copy(nPtr, nBytes, 0, vInt). RETURN nBytes. FINALLY: nPtr = ?. set-size(pmPtr) = 0. nBytes = ?. END. END METHOD. But somewhere in the process, (and I bet it has to do with codepages and stuff) I get different data than what origianlly captured the scanner. That's why I would like to debug and see the data when it's inside the BYTE[] array...

Continue reading...
 
Status
Not open for further replies.
Back
Top