Thread overview
use dll's
Mar 16
ontrail
Mar 16
ontrail
Mar 17
evilrat
March 16
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.
March 16
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
March 16
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.
March 17
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.
March 17
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