What in the heck could I be doing wrong that even the example doesn't run?
Having a bad month, maybe?
I have never messed with trying to create and Windows service. I'm wondering if you could find a non-Qt service example, maybe on the MSDN site (like this one), that you could get working. Services normally run without a GUI, so I also wonder if there is a flag you are missing in the command line that says "run interactively", and without it, you get a background process.
But then there are these lines from the Qt Solutions QtService "interactive" example:
void InteractiveService::start()
{
#if defined(Q_OS_WIN)
logMessage( "Service GUI not allowed on Windows Vista. See the documentation for this example for more information.", QtServiceBase::Error );
return;
}
#endif
void InteractiveService::start()
{
#if defined(Q_OS_WIN)
if ((QSysInfo::WindowsVersion & QSysInfo::WV_NT_based) &&
(QSysInfo::WindowsVersion >= QSysInfo::WV_VISTA)) {
logMessage( "Service GUI not allowed on Windows Vista. See the documentation for this example for more information.", QtServiceBase::Error );
return;
}
#endif
To copy to clipboard, switch view to plain text mode
Windows 7 and 10 certainly pass the >= WV_VISTA test, so you'll see a log message and no GUI.
Bookmarks