Einzelnen Beitrag anzeigen

delphinub23

Registriert seit: 27. Okt 2010
Ort: Chemnitz
110 Beiträge
 
Delphi XE3 Professional
 
#1

Hilfe beim Übersetzen von C++ zu Delphi

  Alt 29. Mai 2012, 14:35
Delphi-Version: 2010
Hallo DPler,

ich möchte diese C++ Struktur nach Delphi übersetzen:

C++:
Code:
typedef struct {
  PARTITION_STYLE PartitionStyle;
     union {
     CREATE_DISK_MBR Mbr;
     CREATE_DISK_GPT Gpt;
    };
  } CREATE_DISK, *PCREATE_DISK;
...meine Übersetzung nach Delphi:

Delphi-Quellcode:
  _CREATE_DISK = packed record
    PartitionsStyle: PARTITION_STYLE;
    Mbr: CREATE_DISK_MBR;
    Gpt: CREATE_DISK_GPT;
  end;
  CREATE_DISK = _CREATE_DISK;
  PCREATE_DISK = ^CREATE_DISK;
Das sollte doch so funktionieren, oder?!
Oder wie soll ich diese "union structure" sonst nach Delphi übersetzen?

Danke für jeden Tipp!
  Mit Zitat antworten Zitat