Delphi-PRAXiS
Seite 2 von 2     12   

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Sonstige Fragen zu Delphi (https://www.delphipraxis.net/19-sonstige-fragen-zu-delphi/)
-   -   Delphi C++ nach Delphi übersetzen (https://www.delphipraxis.net/87032-c-nach-delphi-uebersetzen.html)

Oxmyx 23. Feb 2007 13:31

Re: C++ nach Delphi übersetzen
 
Zitat:

Zitat von SnuffMaster23
Code:
//===========================================================================
// constants for GetSettingPtr(int index) -> returns:
enum {
   SN_STYLESTRUCT     = 0   , // StyleStruct *
   SN_TOOLBAR         = 1   , // StyleItem *
   SN_TOOLBARBUTTON         , // StyleItem *
.
.
.
   SN_MENUFRAME_DISABLECOLOR , // COLORREF *
   SN_LAST
};
Was ist das?

Eine Aufzählung:
Delphi-Quellcode:
type
  TEineAufzaehlung = (
    SN_STYLESTRUCT,
    SN_TOOLBAR,
    SN_TOOLB ARBUTTON,
    ...
    SN_Last)
Zitat:

Und das nochmal, damits nicht untergeht:
Code:
#define PicColor TextColor

class Menu;
class MenuItem;
Mit denen kann ich auch nichts anfangen.
Wird da PicColor der Wert von TextColor zugewiesen?
Werden da zwei Konstanten definiert?
TextColor gibts garnicht, außer als Element von StyleItem :?

Leere Klassendefinitionen??
Durch das #define wird überall, wo PicColor im Quelltext vorkommt, ein TextColor daraus gemacht. Sowas gibt's in Delphi nicht, du musst das entsprechend berücksichtigen.
Die "leeren Klassen" sind keine leeren Klassen, sondern nur Ankündigungen, dass die Klassendefinition noch folgen wird:
Delphi-Quellcode:
type
  TKlasseA = class;

  TKlasseB = class
    klasseA: TKlasseA;
  end;

  TKlasseA = class
    //...
  end;

SnuffMaster23 25. Feb 2007 11:05

Re: C++ nach Delphi übersetzen
 
Da gehts um exportierte Funktionen, aber mehr weiß ich auch nicht :(
Code:
#ifdef __BBCORE__
#define API_EXPORT DLL_EXPORT
#else
#define API_EXPORT
#endif

extern "C" {
   // ------------------------------------
   // Read Settings
   API_EXPORT bool ReadBool(LPCSTR filePointer, LPCSTR string, bool defaultBool);
   API_EXPORT int ReadInt(LPCSTR filePointer, LPCSTR string, int defaultInt);
   API_EXPORT LPCSTR ReadString(LPCSTR filePointer, LPCSTR string, LPCSTR defaultString);
   API_EXPORT COLORREF ReadColor(LPCSTR filePointer, LPCSTR string, LPCSTR defaultString);

   // Read a rc-value as string. If 'ptr' is specified, it can read a sequence of items with the same name.
   API_EXPORT LPCSTR ReadValue(LPCSTR fp, LPCSTR keyword, LPLONG ptr = NULL);

   // Was the last Value actually read from the rc-file ?
   // Returns: 0 == not found / 1 == found exact value / 2 == found wildcard
   API_EXPORT int FoundLastValue(void);
.
.
.
Kommt das einfach in die exports-Klausel?


Alle Zeitangaben in WEZ +1. Es ist jetzt 06:36 Uhr.
Seite 2 von 2     12   

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