www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - use dll's

reply ontrail <test test.com> writes:
hi,
i created a program (windows) and 2 dll's.
how do i use the 2 d-language dll's in a d-language program with 
only one GC?

any help is appreciated.
Mar 16 2019
parent reply Andre Pany <andre s-e-a-p.de> writes:
On Saturday, 16 March 2019 at 12:53:49 UTC, ontrail wrote:
 hi,
 i created a program (windows) and 2 dll's.
 how do i use the 2 d-language dll's in a d-language program 
 with only one GC?

 any help is appreciated.
It is explained here (section d code calling d code in dll) https://wiki.dlang.org/Win32_DLLs_in_D Kind regards Andre
Mar 16 2019
parent reply ontrail <test test.com> writes:
On Saturday, 16 March 2019 at 14:18:07 UTC, Andre Pany wrote:
 On Saturday, 16 March 2019 at 12:53:49 UTC, ontrail wrote:
 hi,
 i created a program (windows) and 2 dll's.
 how do i use the 2 d-language dll's in a d-language program 
 with only one GC?

 any help is appreciated.
It is explained here (section d code calling d code in dll) https://wiki.dlang.org/Win32_DLLs_in_D Kind regards Andre
well thank you kindly. what i don't understand yet, is there a way to have the GC in my program only once instead of several times with the dll's.
Mar 16 2019
next sibling parent evilrat <evilrat666 gmail.com> writes:
On Saturday, 16 March 2019 at 15:13:15 UTC, ontrail wrote:
 On Saturday, 16 March 2019 at 14:18:07 UTC, Andre Pany wrote:
 On Saturday, 16 March 2019 at 12:53:49 UTC, ontrail wrote:
 hi,
 i created a program (windows) and 2 dll's.
 how do i use the 2 d-language dll's in a d-language program 
 with only one GC?

 any help is appreciated.
It is explained here (section d code calling d code in dll) https://wiki.dlang.org/Win32_DLLs_in_D Kind regards Andre
well thank you kindly. what i don't understand yet, is there a way to have the GC in my program only once instead of several times with the dll's.
gc_setProxy is the way, read that article's section again.
Mar 16 2019
prev sibling parent Michelle Long <HappyDance321 gmail.com> writes:
On Saturday, 16 March 2019 at 15:13:15 UTC, ontrail wrote:
 On Saturday, 16 March 2019 at 14:18:07 UTC, Andre Pany wrote:
 On Saturday, 16 March 2019 at 12:53:49 UTC, ontrail wrote:
 hi,
 i created a program (windows) and 2 dll's.
 how do i use the 2 d-language dll's in a d-language program 
 with only one GC?

 any help is appreciated.
It is explained here (section d code calling d code in dll) https://wiki.dlang.org/Win32_DLLs_in_D Kind regards Andre
well thank you kindly. what i don't understand yet, is there a way to have the GC in my program only once instead of several times with the dll's.
Why do you need to do this? It might be more effective to allow multiple GC's. but surely you can set the GC of the dll to use that of the another. You will need to expose a method to set the GC from the dll.. void SetGC(GC gc); type of thing... Where GC is info regarding the GC to do so which I don't know much about. The latest dmd supports hooking ones own GC so it might be just a matter of using those functions to point to the correct gc. https://dlang.org/library/core/memory/gc.html https://forum.dlang.org/thread/mzrxzdmhwuwjiybcbdsr forum.dlang.org
Mar 16 2019