wsv01 Posted February 7, 2019 Share Posted February 7, 2019 Being new at uniGUI I created one of my first system in desktop mode. Now I want to take that same application and get it running under a Windows service. If I create a new service type application with nothing in it, it looks like the app is launched using this code if not Application.DelayInitialize or Application.Installing then Application.Initialize; Application.CreateForm(TUniServiceModule, UniServiceModule); Application.Run; From an earlier post, I have set up my project with DEFINES like this When running in VCL, this it how things are started and all works well {$IFDEF UNIGUI_VCL} ReportMemoryLeaksOnShutdown:=True; // Optional. Application.Initialize; TUniServerModule.Create(Application); Application.CreateForm(TUniServiceModule, UniServiceModule); Application.Run; {$ENDIF} When running as a service, I'm assuming this is how things are started. {$IFDEF UNIGUI_SERVICE} if not Application.DelayInitialize or Application.Installing then Application.Initialize; Application.CreateForm(TMyServiceClass, MyServiceClass); // Get from your service module. Application.Run; {$ENDIF} I'm assuming that I have to kick off the project through the ServiceModule? I'm not sure what to change this line to: Application.CreateForm(TMyServiceClass, MyServiceClass); // Get from your service module. If I change to this, and I open the application, I just get a blank browser and it looks hung. Application.CreateForm(TUniServiceModule, UniServiceModule); BTW: I was able to get the application installed as a service and am able to start and stop the server without issues. Quote Link to comment Share on other sites More sharing options...
wsv01 Posted February 9, 2019 Author Share Posted February 9, 2019 I was able to get this running. I'm not sure, but when I renamed the UniServiceModule to UniServiceModule1 it started working. Quote Link to comment Share on other sites More sharing options...
Freeman35 Posted February 10, 2019 Share Posted February 10, 2019 did you follow that name(s) in "dpr" file ? in {.....} too. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.