Vergleich von Delphi und Visual C++ - Inhalt
Vergleich von Delphi und Visual C++ - Inhalt
Vergleich von Delphi und Visual C++ - Inhalt
Erfolgreiche ePaper selbst erstellen
Machen Sie aus Ihren PDF Publikationen ein blätterbares Flipbook mit unserer einzigartigen Google optimierten e-Paper Software.
<strong>Vergleich</strong> <strong>von</strong> <strong>Delphi</strong> <strong>und</strong> <strong>Visual</strong> <strong>C++</strong> - Kapitel 2B<br />
// Lib1.h<br />
namespace Lib1<br />
{<br />
char Drucke(char c);<br />
...<br />
}<br />
// Lib2.h<br />
namespace Lib2<br />
{<br />
void Drucke(int Len,<br />
char* Text);<br />
...<br />
}<br />
Unit Lib1;<br />
interface<br />
function Drucke(c: char);<br />
...<br />
Unit Lib2;<br />
interface<br />
function Drucke(Len: Integer;<br />
Text: PChar);<br />
...<br />
Ein Aufruf erfolgt dann in der Art:<br />
V<strong>C++</strong><br />
Object Pascal<br />
#include "Lib1.h"<br />
#include "Lib2.h"<br />
Uses<br />
Lib1, Lib2;<br />
Lib1::Drucke('a');<br />
Lib2::Drucke(10, "Hallo Welt");<br />
Lib1.Drucke('a');<br />
Lib2.Drucke(10, 'Hallo Welt');<br />
Selbst einige Bezeichner in der Klassenbibliothek <strong>Delphi</strong>s führen zu Namenskonflikten mit Funktionen des Windows-API, so daß sogar hier manchmal<br />
die Unit-Namen mit angegeben werden müssen (z.B. VCL-Klasse Graphics.TBitmap <strong>und</strong> Record Windows.TBitmap oder VCL-Methode<br />
OleAuto.RegisterClass(...) <strong>und</strong> Funktion Windows.RegisterClass(...)).<br />
Zurück zum <strong>Inhalt</strong>sverzeichnis<br />
Weiter in Kapitel 2.3.6<br />
http://ourworld.compuserve.com/homepages/praxisservice/kapit2b.htm (51 of 52) [19.05.2000 15:30:09]