www.digitalmars.com         C & C++   DMDScript  

digitalmars.D - dll in D + delphi ?

reply "Alexander Panek" <alexander.panek brainsware.org> writes:
Hello,

a friend of mine is working on a game using Delphi. He has got a problem  
with saving the map-files and I wanted to help him with coding, but, to be  
honest, I never used Delphi before. Now I thought about creating a DLL and  
was wondering, if my friend could use the (D-)classes as I placed them in  
the DLL? Maybe anybody has some expieriences with DLLs and other languages  
(especially Delphi ;) ).

Regards,
Alex

-- 
huh? did you say something? :o
Apr 14 2005
parent reply "Carlos Santander B." <csantander619 gmail.com> writes:
Alexander Panek wrote:
 Hello,
 
 a friend of mine is working on a game using Delphi. He has got a 
 problem  with saving the map-files and I wanted to help him with coding, 
 but, to be  honest, I never used Delphi before. Now I thought about 
 creating a DLL and  was wondering, if my friend could use the 
 (D-)classes as I placed them in  the DLL? Maybe anybody has some 
 expieriences with DLLs and other languages  (especially Delphi ;) ).
 
 Regards,
 Alex
 
D can't export classes. You have to export functions (with C or Windows linkage) and call them from Delphi. -- Carlos Santander Bernal JP2, you'll always live in our minds
Apr 14 2005
parent reply "Andreas Schmid" <monkey gmx.info> writes:
When you export D functions in a DLL, can it still uses garbage collection 
and classes internally?

Could you create "global" classes and wrap their member methods using C 
stdcall functions exposed in the .dll?

I also use Delphi (its GUI designer is excellent), but it would be awesome 
if you could program the logic in D and the GUI in Delphi.

-Andreas


"Carlos Santander B." <csantander619 gmail.com> wrote in message 
news:d3mp04$1spt$4 digitaldaemon.com...
 Alexander Panek wrote:
 Hello,

 a friend of mine is working on a game using Delphi. He has got a problem 
 with saving the map-files and I wanted to help him with coding, but, to 
 be  honest, I never used Delphi before. Now I thought about creating a 
 DLL and  was wondering, if my friend could use the (D-)classes as I 
 placed them in  the DLL? Maybe anybody has some expieriences with DLLs 
 and other languages  (especially Delphi ;) ).

 Regards,
 Alex
D can't export classes. You have to export functions (with C or Windows linkage) and call them from Delphi. -- Carlos Santander Bernal JP2, you'll always live in our minds
Apr 15 2005
parent "Carlos Santander B." <csantander619 gmail.com> writes:
Andreas Schmid wrote:
 When you export D functions in a DLL, can it still uses garbage collection 
 and classes internally?
 
 Could you create "global" classes and wrap their member methods using C 
 stdcall functions exposed in the .dll?
 
 I also use Delphi (its GUI designer is excellent), but it would be awesome 
 if you could program the logic in D and the GUI in Delphi.
 
 -Andreas
 
I don't think there'd be any problems. -- Carlos Santander Bernal JP2, you'll always live in our minds
Apr 15 2005