AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Zurück Delphi-PRAXiS Programmierung allgemein Programmieren allgemein Delphi C++ Struct nach Delphi portieren
Thema durchsuchen
Ansicht
Themen-Optionen

C++ Struct nach Delphi portieren

Ein Thema von Zacherl · begonnen am 8. Feb 2011 · letzter Beitrag vom 8. Feb 2011
 
Benutzerbild von himitsu
himitsu

Registriert seit: 11. Okt 2003
Ort: Elbflorenz
44.372 Beiträge
 
Delphi 12 Athens
 
#2

AW: C++ Struct nach Delphi portieren

  Alt 8. Feb 2011, 09:42
Also, der Record selber sieht so aus, von den Daten her:
Delphi-Quellcode:
HPOLY = record
  m_nPolyIndex, m_nWorldIndex: LongInt;
end;
HPOLY() wäre wohl eine Art Constructor, welches bei Delphi-Records nicht gibt, bzw. welches nicht nötig ist, da man es ja manuell aufrufen muß, denn eine automatische Initialisierung gibt es leider nicht
Da wirst'e dir wohl besser eine Init-Prozedur draus machen müssen.

Die nächsten zwei HPOLY( sind och sowas, nut mir Parametern zur Initialisiereung,
also nochein Init, aber mit m_nPolyIndex, m_nWorldIndex: LongInt; als Parameter,
das 3. HPOLY( kannst'e eigentlich weglassen, da es nur den record kopiert, was Delphi automatisch macht.

und danach kommen dann ein paar Klassenoperatoren (Hier im Forum suchenclass operator ).

[add]
Delphi-Quellcode:
HPOLY = record
  FPolyIndex, FWorldIndex: LongInt;
  procedure Init;
  procedure Init(PolyIndex, WorldIndex: LongInt);
  procedure Init(const Source: HPOLY);
//class operator Implicit(const Source: HPOLY): HPOLY;
  class operator Equal (const Source: HPOLY): Boolean;
  class operator NotEqual(const Source: HPOLY): Boolean;
end;
Delphi-Quellcode:
HPOLY = record
  FPolyIndex, FWorldIndex: LongInt;
  class function Init: HPOLY;
  class function Init(PolyIndex, WorldIndex: LongInt): HPOLY;
  class function Init(const Source: HPOLY): HPOLY;
//class operator Implicit(const Source: HPOLY): HPOLY;
  class operator Equal (const Source: HPOLY): Boolean;
  class operator NotEqual(const Source: HPOLY): Boolean;
end;
Delphi-Quellcode:
HPOLY = record
  FPolyIndex, FWorldIndex: LongInt;
  constructor Create;
  constructor Create(PolyIndex, WorldIndex: LongInt);
  constructor Create(const Source: HPOLY);
//class operator Implicit(const Source: HPOLY): HPOLY;
  class operator Equal (const Source: HPOLY): Boolean;
  class operator NotEqual(const Source: HPOLY): Boolean;
end;
Ein Therapeut entspricht 1024 Gigapeut.

Geändert von himitsu ( 8. Feb 2011 um 09:54 Uhr)
  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 01:20 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