Hi,
No, the path is correct. I have changed the "cmd.exe" to "myApp.exe" on the app dir and it starts without window. But if "myApp.exe" is really my Qt app it don't work.
Thanks,
Hi,
No, the path is correct. I have changed the "cmd.exe" to "myApp.exe" on the app dir and it starts without window. But if "myApp.exe" is really my Qt app it don't work.
Thanks,
Òscar Llarch i Galán
I meant maybe your application needs some files which it can't find and crashes before you have a chance to check it out.
Hi,
The application starts if I start it by double clicking on windows explorer.
Maybe the application don't recive window events because the service starts the application without the main window?
Some time ago I programmed an application using MFC and a service that start it as this new application but the MFC application starts without showing the main window and the new Qt application don't start.
Thanks,
Òscar Llarch i Galán
Hi,
The application try to read a config file but removing all this code and only setuping the gui with "ui.setupUi(this);" don't work.
I have added a little code on main.cpp that writes "Hello" on a file. It works executing it but not starting by the service.
Thanks,
Òscar Llarch i Galán
Try compiling and running a non-Qt app like this one:
Qt Code:
int main(){ while(1); return 0; }To copy to clipboard, switch view to plain text mode
If it works, try adding a QCoreApplication and then a QApplication. Observe what happens in each.
Hi,
I compiled the simple application and it starts.
Then I created a simple Qt console application that uses QCoreApplication and it is not started by the service.
Thanks,
Òscar Llarch i Galán
Hi,
I copied the Qt libs on the application dir and the QCoreApplication starts.
Then I tryied to create a QApplication and it starts.
Finally tryied my application and starts.
So, I think that when start the application by a Windows Service, the libs must be on the "system32" dir or on the same dir of the application.
Thanks wysota,
Òscar Llarch i Galán
Hi,
The QTDIR path is set as User variable on Windows, so if the service is started as "LocalSystem" it don't have QTDIR path so when try to start my application don't work.
So one solution could be to set the QTDIR on the Path of the system instead of the path of the current user.
Second solution is to copy the Qt libs into the "system32" folder where are the system libs.
Third solution is to copy the Qt libs on the application directory.
Òscar Llarch i Galán
As I said - a path problem. Your libs must be accessible, regardless of system configuration. The only safe place to put them is system32 directory.
Hi,
Thanks for help,
Òscar Llarch i Galán
Bookmarks