Einzelnen Beitrag anzeigen

Benutzerbild von f.siebler
f.siebler

Registriert seit: 15. Jan 2007
Ort: Hamburg
170 Beiträge
 
Delphi 2006 Professional
 
#1

C++ DLL Header -> Delphi (Struct)

  Alt 29. Aug 2007, 14:40
Moin Moin,

so langsam blicke ich bei der übersetzung durch, naja zumindest bei den einfachen dingen

Nun ist bei mir leider ein neues Problem aufgetreten, und zwar das folgende:

Code:
//$e-----------------------------------------------------------------------------------------------
//   @EnrollEx
//
//   Function   :   Enrolls one finger : Creates a template from a set of acquisitions.
//
//   Input      :   pstEnrolledTemplate->dwTemplateSize supplies the buffer size.
//                  (must be at least TEMPLATE_SIZE).
//                  pUpdateFunc points to a callback function that updates execution status.
//                  pvObject points to an object (context) used by pUpdateFunc.               
//               pCompletionRoutine points to a completion routine called when the operation
//               ends. If this callback is defined, this function behaviour
//                  is asynchronous (See Info section)
//               pvContext points to a context passed to pCompletionRoutine.
//
//   Output      :   pstEnrolledTemplate points to the enrolled template if the operation
//                  succeeded.
//
//  Returns      :   RCDone if the operation succeeded.
//               RCFailed if the operation failed.
//               RCAborted if the operation has been aborted.
//               RCNoDevice if no acquisition device has been found.
//               RCNoSensor if there is no sensor or if the sensor is defective.
//               RCOpenFailed if there is a problem while opening the device.
//               RCBufferTooSmall if the buffer named pstEnrolledTemplate->pbyTemplate is too small
//               RCAllocationFailed if a dynamic allocation failed
//               (lack of memory resource)
//
//   Info      :   If pCompletionRoutine is NULL, this function will not return until the end
//                  of the operation, and will consequently have a synchronous behaviour.
//$e-----------------------------------------------------------------------------------------------
DLLIMPORT DWORD EnrollEx( PSTBioTemplateEx const pstEnrolledTemplate,
                      void (*pUpdateFunc)(PVOID,DWORD) = NULL,
                      PVOID pvObject = NULL,
                      void (*pCompletionRoutine)(DWORD,PVOID) = NULL,
                      PVOID pvContext = NULL);

//$e-----------------------------------------------------------------------------
Code:
// Template
typedef struct {
   DWORD dwTemplateSize;
   DWORD dwTemplateID;
   BYTE* pbyTemplate;
} STBioTemplateEx, *PSTBioTemplateEx;
Daraus habe ich bisher folgendes gemacht:

Delphi-Quellcode:
type
  PSTBioTemplateEx = packed record
     dwTemplateSize : DWORD;
    dwTemplateID : DWORD;
    pbyTemplate: array [0..288] of DWORD;
  end;

function EnrollEx (pstEnrolledTemplate : Pointer; pUpdateFunc : Pointer; pvUpdateCOntext : Pointer; pCompletionRoutine: Pointer; pvCompletionContext : Pointer): DWORD; cdecl; external 'BiometricDll.dll';
probleme bereitet mir der erste Parameter, ich habe ich schon die folgende Funktion Variante getestet:

function EnrollEx (var pstEnrolledTemplate : PSTBioTemplateEx ; pUpdateFunc : Pointer; pvUpdateCOntext : Pointer; pCompletionRoutine: Pointer; pvCompletionContext : Pointer): DWORD; cdecl; external 'BiometricDll.dll'; Leider bisher alles ohne Erfolg, ich vermute, dass ich mich irgendwo grundlegend verrant habe
Ich bekomme keine Fehlermeldung zurück, aber das Gerät macht nichts, in anderen Anwendungen geht es wunderbar (Demo Project in C++)

Wer von euch hat ne Idee! Wäre super...! Und mit "Erklärung" wäre es genial..

Besten Dank &
Viele Grüße aus Hamburg
Fabian
sql-praxis.net: sql von der Theorie in die Praxis...
  Mit Zitat antworten Zitat