Einzelnen Beitrag anzeigen

Benutzerbild von yörsch
yörsch

Registriert seit: 10. Jan 2007
Ort: Lampertheim
206 Beiträge
 
Delphi XE2 Architect
 
#4

Re: DLL Aufruf (void**)&aImgFormat nach Delphi

  Alt 11. Jan 2007, 08:47
So sieht die definition in C aus:


Code:
DWORD WINAPI FX_GetCapability(    IN int iCamId, IN eBCAMQUERYCAP eCap, IN int iIdent, OUT PVOID * ppCap, OUT int * piCapNumber );


typedef struct {
   int   iFormat;      
   int    iSizeX;
   int     iSizeY;
   int    iPixelBytes;
   int     iPixelBits;
   char *    aName;
   int   iColor;
   float   iSizeRoiScaleX;
   float   iSizeRoiScaleY;
   SIZE   sOffset;

}tBoImgFormat, *tpBoImgFormat;

und so sieht meine umsetzung aus

Delphi-Quellcode:
tBoImgFormat = record
    iFormat : integer ;
    iSizeX : LongWord;
    iSizeY : LongWord;
    iPixelBytes : LongWord;
    iPixelBits : LongWord;
    aName : PCHAR;
    iColor    : LongWord;   
    iSizeRoiScaleX : integer;
    iSizeRoiScaleY : integer;
    sOffset : t_size;
    iMinPacketSize : LongWord;
    iMaxPacketSize : LongWord;
  end;
  tpBoImgFormat = ^tBoImgFormat;
 
  aImgFormat : array of tpBoImgFormat;
  HELP : String;

  ...

  fReturn := FX_GetCapability(0, 0, 0, @aImgFormat , @nImgFormat );

  for j := 0 to nImgFormat -1 do
    begin
       HELP := Format('Format[%02d] WxH:%04dx%04d Bpp/Bits:%d/%02d ',
                          [aImgFormat[j]^.iFormat, aImgFormat[j]^.iSizeX,
                           aImgFormat[j]^.iSizeY, aImgFormat[j]^.iPixelBytes,
                           aImgFormat[j]^.iPixelBits ]);
       SetStati('Capability ' + inttostr(J),Help);
    end;
Gruß
Jörg
Jörg
have FUN
  Mit Zitat antworten Zitat