www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.learn - Windows DLL / Windows service

reply Etienne Cimon <etcimon gmail.com> writes:
Hello,

I'm looking to compile a server into a windows service, and there 
doesn't seem to be any info out there except this : 
http://forum.dlang.org/thread/c95ngs$1t0n$1 digitaldaemon.com

It doesn't call rt_init, would that be the only thing missing from there?

Also, the d runtime seems to have a windows dll module 
https://github.com/D-Programming-Language/druntime/blob/master/src/core/sys/windows/dll.d

no documentation though. Any idea how to attach/detach with a known 
example? I'd also like to create a windows DLL that compiles through 
DMD/GDC/LDC with extern(c) so that folks from C++ can link with it .
Jun 07 2014
parent reply "Adam D. Ruppe" <destructionator gmail.com> writes:
On Saturday, 7 June 2014 at 14:41:15 UTC, Etienne Cimon wrote:
 no documentation though. Any idea how to attach/detach with a 
 known example? I'd also like to create a windows DLL that 
 compiles through DMD/GDC/LDC with extern(c) so that folks from 
 C++ can link with it .
Check this out: http://wiki.dlang.org/Win32_DLLs_in_D should help you get started.
Jun 07 2014
parent reply "Etienne" <etcimon gmail.com> writes:
On Saturday, 7 June 2014 at 16:07:47 UTC, Adam D. Ruppe wrote:
 On Saturday, 7 June 2014 at 14:41:15 UTC, Etienne Cimon wrote:
 no documentation though. Any idea how to attach/detach with a 
 known example? I'd also like to create a windows DLL that 
 compiles through DMD/GDC/LDC with extern(c) so that folks from 
 C++ can link with it .
Check this out: http://wiki.dlang.org/Win32_DLLs_in_D should help you get started.
Looks good ! I couldn't find a more recent example for a service but it should be similar I guess
Jun 07 2014
parent "Tyler Jensen" <tyler tsjensen.com> writes:
On Saturday, 7 June 2014 at 16:16:28 UTC, Etienne wrote:
 On Saturday, 7 June 2014 at 16:07:47 UTC, Adam D. Ruppe wrote:
 On Saturday, 7 June 2014 at 14:41:15 UTC, Etienne Cimon wrote:
 no documentation though. Any idea how to attach/detach with a 
 known example? I'd also like to create a windows DLL that 
 compiles through DMD/GDC/LDC with extern(c) so that folks 
 from C++ can link with it .
Check this out: http://wiki.dlang.org/Win32_DLLs_in_D should help you get started.
Looks good ! I couldn't find a more recent example for a service but it should be similar I guess
Hope this helps. https://github.com/duovia/WindowsServiceInD I'm using the Windows API library (source actually) on dsource.org. See link on the github page. I found it difficult to find a complete solution to the problem, so I'm going to cross post in a few places to make it easier to find for others seeking an answer to the same question.
Aug 22 2014