QApplication - exec() in Windows Service
-
Hello,
i created a Windows Service, without QService... is it possible to add the exec Command?
I go into the Service, create the Gui ... all done but if i try in my ServiceMain funktion to do a.exec() it fails. Here is some Code:
@
QApplication *a;
int Main(...)
{
Gui_class *gc = new Gui_class; //here is the gui createt and it works
//some connect(); funktions
//some winService code
//call ServiceMain(DWORD argc, LPTSTR *argv)
return 0;
}void WINAPI ServiceMain(DWORD argc, LPTSTR *argv)
{
do some stuff
//start QThread .... it works
// a->exec();
while(serviceRun)
{
}
}
@The Problem now is if some signals from the tread comes, the gui didnt execute. But my code is correct because it work without the windows service.
If i return the a->exec(), in the main funktion it works but only if the service is shutting down...
Please help me i have to implement the Gui in the service ... is there a way?
Thank you for your time...