Re: Creating a service, Windows 10, Qt 5.4.1,
LOL. Thanks for all the help anyway. I may be leaving this job soon, so I don't know if you'll hear from me again. But from what I understand, the new job may have me working in Qt also, so you may not be rid of me yet. :)
Re: Creating a service, Windows 10, Qt 5.4.1,
Onward and upward. Best of luck.
Re: Creating a service, Windows 10, Qt 5.4.1,
Quote:
Originally Posted by
TonyInSoMD
I had a command line server program written, and I thought it would just be a matter of adding/changing a few lines of code to make it a QtService. Didn't work. I tried making a blank one from scratch in Visual Studio 2013. Started out I made a command line (QCoreApplication) project. Then I tried to create an empty service using add class. Named the class MyService (I had to call it something) made the base class QCoreApplication, left constructor signature blank. Once created, I put all the appropriate values in the constructor. I then added "qtservice.h" and added the code to make it a QtService<QCoreApplication>.
Then I added all the virtual functions. I left them as empty functions. What it looks like when the compile fails is that QtService<QCoreApplication> is not inheriting QObject. A while back I made a gui service but you can't do that anymore so it got scrapped but I still have the code. On that one I used QtWidgets/QApplication to make an application and then changed the .h and .cpp files to match a QtService, included the .h file, and added the necessary functions (start, stop, etc.) and it compiled fine. I checked the project settings and they are all set to include qtservice. I also tried it with and without Q_OBJECT* at the beginning of the class. What am I doing wrong? added this after post. I'm getting error C2039 staticMetaObject is not a member of QtService<QCoreApplication>. When I looked it up online it said in several places that it's not inheriting QObject.
but what exactly was the C2039 error?
because I have always found this error
Re: Creating a service, Windows 10, Qt 5.4.1,
Thanks for all the help anyway. I may be leaving this job soon, so I don't know if you'll hear from me again.
Re: Creating a service, Windows 10, Qt 5.4.1,
thank you for help and for all this explications