Re: Win32 DLLs in D

2020-06-05 Thread Виталий Фадеев via Digitalmars-d-learn

On Friday, 5 June 2020 at 18:00:40 UTC, Poyeyo wrote:

Hello everyone.

I want to create a windows plugin.dll that could be called from 
rFactor, and I want to try D first, instead of going directly 
to C++ as the rFactor example.


I am trying to wrap my head around this:

https://wiki.dlang.org/Win32_DLLs_in_D

... which seems quite outdated,

and this:

https://forum.dlang.org/post/mscgsclxwtjcferfx...@forum.dlang.org

... which seems incomplete,

... and dub, which makes a mess of all my efforts.

Can someone with the right knowledge please update the wiki 
with a modern example that also uses dub for both the Dll and 
the test program?


Dub is not a requirement, just a convenience that would be much 
appreciated.


Best regards.


D language dll example.
Creating DLL for hook create, activate, destroy window and hook 
keyboard events.


https://github.com/vitalfadeev/dlang-dll


Re: Win32 DLLs in D

2020-06-05 Thread Andre Pany via Digitalmars-d-learn

On Friday, 5 June 2020 at 18:00:40 UTC, Poyeyo wrote:

Hello everyone.

I want to create a windows plugin.dll that could be called from 
rFactor, and I want to try D first, instead of going directly 
to C++ as the rFactor example.


I am trying to wrap my head around this:

https://wiki.dlang.org/Win32_DLLs_in_D

... which seems quite outdated,

and this:

https://forum.dlang.org/post/mscgsclxwtjcferfx...@forum.dlang.org

... which seems incomplete,

... and dub, which makes a mess of all my efforts.

Can someone with the right knowledge please update the wiki 
with a modern example that also uses dub for both the Dll and 
the test program?


Dub is not a requirement, just a convenience that would be much 
appreciated.


Best regards.


Hi,

Create a new dub package with dub init and afterwards change the 
filename app.d to lib.d. Use as file content


``` d
import core.sys.windows.dll;
mixin SimpleDllMain

extern(C) void sample() nothrow
{
}
```

In dub.json set targetType to "dynamicLibrary".

Build with `dub build`

(Written from my mobile, with the knowledge, as far as I 
remember).


Kind regards
Andre


Win32 DLLs in D

2020-06-05 Thread Poyeyo via Digitalmars-d-learn

Hello everyone.

I want to create a windows plugin.dll that could be called from 
rFactor, and I want to try D first, instead of going directly to 
C++ as the rFactor example.


I am trying to wrap my head around this:

https://wiki.dlang.org/Win32_DLLs_in_D

... which seems quite outdated,

and this:

https://forum.dlang.org/post/mscgsclxwtjcferfx...@forum.dlang.org

... which seems incomplete,

... and dub, which makes a mess of all my efforts.

Can someone with the right knowledge please update the wiki with 
a modern example that also uses dub for both the Dll and the test 
program?


Dub is not a requirement, just a convenience that would be much 
appreciated.


Best regards.