You are not logged in.

1

Wednesday, July 6th 2011, 4:13pm

Windows Service GUI Application won't launch... Interactive Services Detection

Hi all,

So I'm currently trying to wrap my GUI application into a service using QtService. I get the problem described here:

http://blogs.msdn.com/b/patricka/archive…king-at-me.aspx


When I view the message, I can see the application over top a blank screen. Here's my service start code, followed by my main:

Source code

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
void Service::start(){
    if (!QSystemTrayIcon::isSystemTrayAvailable()) {
        qFatal("No system tray available, unable to launch.");
    }

    QApplication::setQuitOnLastWindowClosed(false);

    window = new AppWindow();
    window->show();
}
int main(int argc, char *argv[])
{ qInstallMsgHandler(logOutputHandler);
    Q_INIT_RESOURCE(resources);
    Service service(argc, argv);
    return service.exec();}



Does anyone know a way around this?

Thanks!

2

Wednesday, July 6th 2011, 6:19pm

Next thing I've tried was creating an entirely different project, with just a simple service that starts the executable using QProcess. Still produces the same result unfortunately.

Edit: Also tried simply exec'ing a script that starts the program from the service, and it STILL blocks it!

This post has been edited 1 times, last edit by "tkdiamond08" (Jul 6th 2011, 7:50pm)