Click here to Skip to main content
15,896,118 members
Articles / Programming Languages / C++

QServiceTool - A Beginner's Guide to Qt and NT Services

Rate me:
Please Sign up or sign in to vote.
4.91/5 (13 votes)
18 May 2003CPOL6 min read 121K   1.1K   27  
A Qt based tool designed to control Windows NT services (start, stop, pause, continue) and to show information about them.
/**
  \file    QServiceTool_Main.cpp
  \brief   Main Source File for QServiceTool
  \date    2003-05-19
  \author  Christian Richardt (cr@whizer.net)
**/


  #include <qapplication.h>
  #include "QServiceTool.h"


    // we need this library
  #pragma comment(lib, "qt-mt230nc.lib")

    // solves certain problems with Qt *g*
  QStringData* QString::shared_null = 0;

    // QApplication should be available within all source files
  extern QApplication* qApp = 0;


  int main(int argc, char **argv)
   {
      // new QApplication
    qApp = new QApplication(argc, argv);

      // our widget (derived from QWidget)
    QServiceTool* qms = new QServiceTool(0, "QServiceTool");

      // show it!
    qms->show();

      // set to main widget within our application
      // (there is only one main widget)
    qApp->setMainWidget( qms );

      // execute (mainloop)
    return qApp->exec();
   }

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions