Autor Beitrag
peeage
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 50



BeitragVerfasst: Fr 04.06.10 20:13 
Hallo zusammen,

ist es möglich in einer DLL (in Delphi geschrieben) ein Interface- Pointer entgegenzunehmen (z.B. aus einer Applikation die in C++ geschrieben wurde und die DLL aufruft) um dann auf die Methoden des Interfaces zuzugreifen? Wenn ja, ist dann auch der umgekehrte Fall möglich (die C++ Applikation greift auf ein Interface in der Delphi DLL zu)?
peeage Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 50



BeitragVerfasst: Sa 05.06.10 10:35 
Keiner 'ne Antwort?
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Sa 05.06.10 11:46 
Wenn dein Interface ein COM Interface ist, ja (auf die Calling-Convention achten und die Interfaces richtig übersetzen; Keine Delphi Strings übergeben sondern PChar oder WideString).
peeage Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 50



BeitragVerfasst: So 06.06.10 11:51 
Ein COM Interface ist doch auch nur ein normales Interface, oder? ... Nur das eben auf die Calling- Convention und die Parameter geachtet werden muss, oder lieg ich da falsch?
delfiphan
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Beiträge: 2684
Erhaltene Danke: 32



BeitragVerfasst: Mi 09.06.10 21:13 
Gib dem Interface eine GUID und implementiere die 3 Methoden in IUnknown (bzw. leite z.B. von TInterfacedObject ab) und verwende stdcall calling convention. Ist zwar nicht alles zwingend, aber üblich.
Du kannst auch ein Dual interfaces definieren (implementiert zusätzlich IDispatch), dann kannst du die Objekte zusätzlich in VB-Scripts oder JScript verwenden.