Delphi-PRAXiS

Delphi-PRAXiS (https://www.delphipraxis.net/forum.php)
-   Object-Pascal / Delphi-Language (https://www.delphipraxis.net/32-object-pascal-delphi-language/)
-   -   Delphi C# source in Delphi portieren! (https://www.delphipraxis.net/30640-c-source-delphi-portieren.html)

Kostas 27. Sep 2004 15:09


C# source in Delphi portieren!
 
Hallo Zusammen,

es geht um eine ActivX-Komponente welche eine Beispielanwendung
in c++, VB und C# aber leinder kein Delphi hat.

Die folgende Zeile erzeugt zur Laufzeit ein Objekt.
Das Objekt iwGeoPoint hat jedoch keinen Constructor Create.

IWGEOOBJECTSLib.iwGeoPoint point = new IWGEOOBJECTSLib.iwGeoPoint();

Wie kann ich das Objekt in Delphi erzeugen?


Gruß Kosts

nailor 27. Sep 2004 15:25

Re: C# source in Delphi portieren!
 
IWGEOOBJECTSLib.iwGeoPoint point = new IWGEOOBJECTSLib.iwGeoPoint();

des is n constructor.

ind delphi:

Delphi-Quellcode:
point := IWGEOOBJECTSLib.iwGeoPoint.Create();

Kostas 27. Sep 2004 15:40

Re: C# source in Delphi portieren!
 
Hallo Nailor,

das dachte ich auch, aber genau das funkt nicht weil
iwGeoPoint keine Methode Create hat.

iwGeoPoint.Create gibt es nicht

Irgend eine Idee?


Gruß kostas

nailor 27. Sep 2004 16:04

Re: C# source in Delphi portieren!
 
die funktion(en) mit gleichem namen wie die klasse sind constructoren. wenn du nach d portieren willst, musst du die entspr. umbenennen

Kostas 27. Sep 2004 16:29

Re: C# source in Delphi portieren!
 
Hallo Nailor,

entschuldige bitte wenn ich Dich nicht verstehe.
Ist es Dir möglich mir ein kleines Beispiel zu erzeugen.

Übrigens in den C++ sourcecodes habe ich eine ähnliche stelle
gefunden. In C++ sieht es so aus:

IiwGeoPoint iwGeoPoint;
iwGeoPoint.CreateDispatch( "IwGeoObjects.iwGeoPoint.1" );
Ich hoffe es ist das gleiche :-(


Unter Delphi kenne ich eigentlich nur eine Möglichkeit:

procedure ...
var MyPoint :iwGeoPoint;
begin
MyPoint := iwGeoPoint.Create;
try
MyPoint.irgendwas;
finally
MyPoint.free;
end;
end;






Gruß Kostas.


Alle Zeitangaben in WEZ +1. Es ist jetzt 05:21 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