![]() |
Re: Tipps für Header-Übersetzungen
Zitat:
Ich wollte eigentlich über ![]() In der D7 Hilfe steht Privates Symbol --------------- Typ Parameter Syntax {$NODEFINE Bezeichner} Anmerkungen Die Direktive NODEFINE verhindert, dass das angegebene Symbol in die für C++ generierte Header-Datei aufgenommen wird, während bestimmte Informationen in die Objektdatei ausgegeben werden können. Wenn Sie NODEFINE verwenden, liegt es in Ihrer eigenen Verantwortung, mit HPPEMIT alle benötigten Typen zu definieren. Ein Beispiel:
Delphi-Quellcode:
type
Temperature = type double; {$NODEFINE Temperature} {$HPPEMIT 'typedef double Temperature'} In der Types.pas von Delphi 7 finde ich folgenden Code:
Delphi-Quellcode:
Hier werden wohl in C++ Syntax die Delphi Typen für den C++ Header deklariert.
...
PPoint = ^TPoint; TPoint = packed record X: Longint; Y: Longint; end; {$NODEFINE TPoint} tagPOINT = TPoint; {$NODEFINE tagPOINT} PRect = ^TRect; TRect = packed record case Integer of 0: (Left, Top, Right, Bottom: Longint); 1: (TopLeft, BottomRight: TPoint); end; {$NODEFINE TRect} ... (*$HPPEMIT 'namespace Types'*) (*$HPPEMIT '{'*) (*$HPPEMIT ' struct TPoint : public POINT'*) (*$HPPEMIT ' {'*) (*$HPPEMIT ' TPoint() {}'*) (*$HPPEMIT ' TPoint(int _x, int _y) { x=_x; y=_y; }'*) (*$HPPEMIT ' TPoint(POINT& pt)'*) (*$HPPEMIT ' {'*) (*$HPPEMIT ' x = pt.x;'*) (*$HPPEMIT ' y = pt.y;'*) (*$HPPEMIT ' }'*) (*$HPPEMIT ' };'*) (*$HPPEMIT ' '*) (*$HPPEMIT ' typedef TPoint tagPoint;'*) (*$HPPEMIT ' '*) (*$HPPEMIT ' struct TRect : public RECT'*) (*$HPPEMIT ' {'*) (*$HPPEMIT ' TRect() {}'*) (*$HPPEMIT ' TRect(const TPoint& TL, const TPoint& BR) { left=TL.x; top=TL.y; right=BR.x; bottom=BR.y; }'*) (*$HPPEMIT ' TRect(int l, int t, int r, int b) { left=l; top=t; right=r; bottom=b; }'*) (*$HPPEMIT ' TRect(RECT& r)'*) (*$HPPEMIT ' {'*) (*$HPPEMIT ' left = r.left;'*) (*$HPPEMIT ' top = r.top;'*) (*$HPPEMIT ' right = r.right;'*) (*$HPPEMIT ' bottom = r.bottom;'*) (*$HPPEMIT ' }'*) (*$HPPEMIT ' int Width () const { return right - left; }'*) (*$HPPEMIT ' int Height() const { return bottom - top ; }'*) (*$HPPEMIT ' bool operator ==(const TRect& rc) const '*) (*$HPPEMIT ' {'*) (*$HPPEMIT ' return left == rc.left && top==rc.top && '*) (*$HPPEMIT ' right == rc.right && bottom==rc.bottom; '*) (*$HPPEMIT ' }'*) (*$HPPEMIT ' bool operator !=(const TRect& rc) const '*) (*$HPPEMIT ' { return !(rc==*this); }'*) (*$HPPEMIT ' '*) (*$HPPEMIT ' __property LONG Left = { read=left, write=left }; '*) (*$HPPEMIT ' __property LONG Top = { read=top, write=top }; '*) (*$HPPEMIT ' __property LONG Right = { read=right, write=right }; '*) (*$HPPEMIT ' __property LONG Bottom = { read=bottom, write=bottom }; '*) (*$HPPEMIT ' };'*) (*$HPPEMIT '} /* namespace Types */ ;'*) ... Das ist alles was ich dazu weiß. Ich hoffe das hilt Dir Luckie |
Re: Tipps für Header-Übersetzungen
Die Win32 Konversion von Marcel van Brakel (
![]() Entweder dort herunterladen oder warten bis wir das SourceForge-Projekt fertig haben. Wir stricken gerade fleissig dran. |
Re: Tipps für Header-Übersetzungen
Zitat:
![]() |
Alle Zeitangaben in WEZ +1. Es ist jetzt 01:52 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