AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Sprachen und Entwicklungsumgebungen Object-Pascal / Delphi-Language Delphi C++ DLL / Konvertierung der Header-Datei nach Delphi
Thema durchsuchen
Ansicht
Themen-Optionen

C++ DLL / Konvertierung der Header-Datei nach Delphi

Ein Thema von Magickweis · begonnen am 23. Jun 2007 · letzter Beitrag vom 2. Jul 2007
 
Magickweis

Registriert seit: 23. Jun 2007
5 Beiträge
 
#8

Re: C++ DLL / Konvertierung der Header-Datei nach Delphi

  Alt 1. Jul 2007, 19:40
Ich schon wieder - jaja, mühsam ernährt sich das Eichhörnchen. Ich bitte einen Fachkundigen kurz einen Blick auf folgende Konversionen zu werfen. Ist das so korrekt? Danke!



P.S.: Sollte die Übersetzung der Header-Files gelingen, werde ich selbstverständlich das ganze hier der Allgemeinheit zur Verfügung stellen - könnte ja sein, daß noch jemand seine Canon Powershot mit Delphi ansteuern möchte.

1)

Code:
typedef void      prVoid;
typedef unsigned char   prUInt8;
typedef   char      prInt8;
typedef char      prChar;
#ifndef macintosh
typedef unsigned short   prWChar;
#endif
typedef unsigned short   prUInt16;
typedef short      prInt16;
typedef unsigned long   prUInt32;
typedef long      prInt32;
typedef float      prFloat32;
#ifdef macintosh
typedef UInt64      prUInt64;
#else
typedef unsigned __int64 prUInt64;
#endif
typedef prUInt32   prResponse;
typedef prUInt16   prBoolean;
typedef prUInt32   prTime;
typedef prUInt32   prEventID;
typedef prUInt32   prContext;

#ifdef macintosh
typedef FSSpec      prFSSpec;
#endif

#ifdef macintosh
typedef prUInt32    prHWND;
#else   
typedef HWND      prHWND;
#endif
typedef prUInt32   prHandle;
typedef prUInt32   prObjectHandle;
Delphi-Quellcode:
type
  prUInt8 = Byte;
  prInt8 = Char;
  prChar = Char;
  prWChar = Word;
  prUInt16 = Word;
  prInt16 = SmallInt;
  prUInt32 = LongWord;
  prInt32 = LongInt;
  prFloat32 = Single;
  prUInt64 = UInt64;
  prResponse = prUInt32;
  prBoolean = prUInt16;
  prTime = prUInt32;
  prEventID = prUInt32;
  prContext = prUInt32;
  prHWND = HWND;
  prHandle = prUInt32;
  prObjectHandle = prUInt32;
--------------------------------------------------------

2)

Code:
typedef struct{
   prWChar ModuleName[512];            /* Module name (512 characters)   */
   prWChar Version[32];               /* Version (32 characters) */
}prVerInfo;

typedef struct{
   prUInt32  Entry;                  /* Number of modules included in this structure */
   prVerInfo VerInfo[prANY];             /* Array of file version number information of PS-ReC SDK modules */
}prDllsVerInfo;

typedef struct{
   prWChar          DeviceInternalName[512];   /* Internal devicve name (512 characters) */
   prWChar            ModelName[32];            /* Camera model name (32 characters) */
   prUInt16         Generation;            /* Camera generation number */
   prUInt32        Reserved1;            /* Reserved */
   prUInt32         ModelID;               /* Camera model ID */
   prUInt16        Reserved2;            /* Reserved */
   prPorttype         PortType;               /* Port type 0x01�FWIA / 0x02�FSTI */
   prUInt32        Reserved3;            /* Reserved */
}prDeviceInfoTable;

typedef struct{
   prUInt32   NumList;               /* Number of camera device information included in this structure */
   prDeviceInfoTable DeviceInfo[prANY];   /* Camera device information */
}prDeviceList;

typedef struct{
   prProgressMsg lMessage;               /* Message */
   prProgressSts lStatus;               /* Status */
   prUInt32     lPercentComplete;         /* The uint of this parameter is percent */
   prUInt32     lOffset;               /* Offset */
   prUInt32     lLength;               /* Size */
   prUInt32     lReserved;            /* Reserved */
   prUInt32     lResLength;            /* Reserved */
   prUInt8 *     pbData;               /* Pointer to the buffer in which the transferred data is stored. */
}prProgress;
Delphi-Quellcode:
type
  prVerInfo = packed record
    ModuleName : Array [0..512] of prWChar;
    Version : Array [0..32] of prWChar;
  end;

  prDllsVerInfo = packed record
    Entry : prUInt32;
    VerInfo : Array [0..prANY] of prVerInfo;
  end;

  prDeviceInfoTable = packed record
    DeviceInternalName   : Array [0..512] of prWChar;
    ModelName      : Array [0..32] of prWChar;
    Generation      : prUInt16;
    Reserved1      : prUInt32;
    ModelID      : prUInt32;
    Reserved2      : prUInt16;
    PortType      : prPortType;
    Reserved3      : prUInt32;
  end;

  prDeviceList = packed record
    NumList      : prUInt32;
    DeviceInfo      : Array [0..prANY] of prDeviceInfoTable;
  end;

  prProgress = packed record
    lMessage      : prProgressMsg;
    lStatus      : prProgressSts;
    lPercentComplete   : prUInt32;
    lOffset      : prUInt32;
    lLength      : prUInt32;
    lReserved      : prUInt32;
    lResLength      : prUInt32;
    pbData      : prUInt8;
  end;
--------------------------------------------------------

3)

Code:
#define prSUB_GENERATION_CAMERA(gen)   ((gen&prGENERATION_CAMERA_MASK)>>8)
Delphi-Quellcode:
function prSUB_GENERATION_CAMERA(gen : Integer) : Integer;
begin
  prSUB_GENERATION_CAMERA := ((gen and prGENERATION_CAMERA_MASK) shr 8);
end;
  Mit Zitat antworten Zitat
 


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 03:32 Uhr.
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024-2025 by Thomas Breitkreuz