Page 2 of 2 FirstFirst 12
Results 21 to 25 of 25

Thread: Creating a service, Windows 10, Qt 5.4.1,

  1. #21
    Join Date
    Mar 2014
    Location
    USA
    Posts
    82
    Thanks
    16
    Thanked 2 Times in 2 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default 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.

  2. #22
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    4,060
    Thanks
    233
    Thanked 649 Times in 639 Posts
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows Android

    Default Re: Creating a service, Windows 10, Qt 5.4.1,

    Onward and upward. Best of luck.
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #23
    Join Date
    Jan 2019
    Posts
    3
    Qt products
    Qt4
    Platforms
    Android

    Default Re: Creating a service, Windows 10, Qt 5.4.1,

    Quote Originally Posted by TonyInSoMD View Post
    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

  4. #24
    Join Date
    Jan 2019
    Posts
    3
    Qt products
    Qt4
    Platforms
    Android

    Default 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.

  5. #25
    Join Date
    Jan 2019
    Posts
    3
    Qt products
    Qt4
    Platforms
    Android

    Default Re: Creating a service, Windows 10, Qt 5.4.1,

    thank you for help and for all this explications

Similar Threads

  1. How do I create a Windows Service in Qt?
    By ayanda83 in forum Qt Programming
    Replies: 1
    Last Post: 11th September 2017, 12:16
  2. How to install a service in windows with automatic startup?
    By josecarlosmissias in forum Qt Programming
    Replies: 0
    Last Post: 11th December 2009, 17:01
  3. Start Qt application as Windows Service
    By ^NyAw^ in forum Qt Programming
    Replies: 12
    Last Post: 10th May 2008, 17:23
  4. Creating QDS service
    By bowser in forum Qt for Embedded and Mobile
    Replies: 1
    Last Post: 29th October 2007, 11:12
  5. Windows Service
    By TheGrimace in forum Qt Programming
    Replies: 3
    Last Post: 5th October 2007, 19:46

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.