Creating a daemon from a dll lazarus / 34-Windows ---------------------------------------------------------------------- Robert Gilland · 2015-12-09 11:24 HI, wanting to create a daemon, that on before install and before uninstall, loads a dll, to fill out the Tdaemonmapper properties. So basically the daemon is a shell to run code that is stored in a dll. Then when windows runs the srevice, it passes the daemon the dll path as a parameter, and the daemon executes a function within the daemon. Do you think it is possible. I am doing this because I want to have the code fully debuggable inside a dll, which can either be run via a executable for dubugging purposes, or via windows services for stability. Kind Regards, Robert. ---------------------------------------------------------------------- Robert Gilland · 2015-12-11 03:43 OK after much trial and error I found you can add a parameter to a service directly via the registry at \SYSTEM\CurrentControlSet\Services\ And this approach is possible ---------------------------------------------------------------------- balazsszekely · 2015-12-11 07:37 @Robert Gilland What about adding the dll as resource to the service, then load it directly from memory? No parameters needed. ---------------------------------------------------------------------- Robert Gilland · 2015-12-11 12:00 Because I want the dll to be completely independent of the service. So I  can compile the service once and each time I need a new service. I just install it as a command line option. So I  write the service once. Still testing but results are looking good . Also my dll is written in Delphi. ---------------------------------------------------------------------- Robert Gilland · 2015-12-13 01:05 The situation has become dire: I am not able to stop the daemon with error: The specified resource type cannot be found in the image file Which leads me to "GetMem" response. Could you please indicate how you would add the DLL as a resource, without using parameters? Kind Regards, Robert. ---------------------------------------------------------------------- balazsszekely · 2015-12-13 07:26 @Robert Gilland 1. You can find a small dll inside TestDll folder. The dll exports a function which add two numbers. You can also find a DllRes.rc file, from which I created the DllRes.RES. 2. The main project loads the dll from resource then calls function Add from memory. Nothing is saved to HDD.