I have a small console app that will do some post install file & text proccessing. I need it to be self terminating & I need it to NOT show a console while running. I tried a.quit() & a.exit() to terminate, but neither one worked. I'm not sure how to supress the console window. The app will run on Win.

Any help is appreciated.

Thanx,

Ed

Qt Code:
  1. #include <QTextStream>
  2. #include <QString>
  3. #include <QFile>
  4.  
  5. QTextStream cout(stdout, QIODevice::WriteOnly);
  6. QTextStream cerr(stderr, QIODevice::WriteOnly);
  7.  
  8. int main(int argc, char *argv[])
  9. {
  10. QCoreApplication a(argc, argv);
  11. QString str1, str2;
  12. QFile file("fixPath.txt");
  13. if(file.open(QIODevice::ReadOnly))
  14. {
  15. QTextStream in(&file);
  16. while (not in.atEnd())
  17. {
  18. str1 = in.readLine();
  19. cout << str1 << endl;
  20. }
  21. file.close();
  22. }
  23.  
  24. return a.exec();
  25. }
To copy to clipboard, switch view to plain text mode