Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi Ein struct aus C to Delphi... (https://www.delphipraxis.net/53937-ein-struct-aus-c-delphi.html)

sniper_w 25. Sep 2005 20:31


Ein struct aus C to Delphi...
 
Delphi-Quellcode:
(*
struct in_addr {
        union {
                struct { UCHAR s_b1,s_b2,s_b3,s_b4; } S_un_b;
                struct { USHORT s_w1,s_w2; } S_un_w;
                ULONG S_addr;
        } S_un;
};
*)
type in_addr = record
   case Integer of
   1 : (S_un_b : record s_b1,s_b2,s_b3,s_b4: Byte end; );
   2 : ( S_un_w : record s_w1,s_w2: Word end; );
   3 : ( S_addr: Longword );
   end;
Habe ich das richtig gemacht ? Ich meine, es wird schon kompiliert, aber ist es richtig so?

Chewie 25. Sep 2005 21:06

Re: Ein struct aus C to Delphi...
 
Schau mal in die Unit Winsock ;)

himitsu 25. Sep 2005 21:16

Re: Ein struct aus C to Delphi...
 
Falls nicht ... für mich sieht es jedenfalls OK aus.

tommie-lie 25. Sep 2005 21:37

Re: Ein struct aus C to Delphi...
 
C-Records sind i.d.R. Delphi-Referenz durchsuchenpacked.

himitsu 25. Sep 2005 21:51

Re: Ein struct aus C to Delphi...
 
ups, da haste wohl Recht, aber der Rest wird wohl stimmen :roll:

sniper_w 25. Sep 2005 23:41

Re: Ein struct aus C to Delphi...
 
In zwischen habe ich es auch selbst herausgefunden. ;) Danke.


Alle Zeitangaben in WEZ +1. Es ist jetzt 08:56 Uhr.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz