Results 1 to 2 of 2

Thread: QProcess start automaticaly needed application

  1. #1
    Join Date
    Jan 2006
    Posts
    273
    Thanks
    42
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4
    Platforms
    Windows

    Default QProcess start automaticaly needed application

    Hi everybody,

    OS: WINXP
    Compiler: MINGW
    QT: 3.4


    The following code works perfect. My problem is that office is installed on machines in different path for example: "C\Program files\Office" or "D:\Office"
    How could i be sure that my file can be opened with EXCEL in every Machine?
    Qt Code:
    1. QProcess *p = new QProcess();
    2. p->addArgument("D:\\Apps\\Microsoft Office\\Office10\\excel.exe");
    3. p->addArgument("W:\\inventar\\Reports\\" + fileName);
    4.  
    5. p->start();
    To copy to clipboard, switch view to plain text mode 

    THX
    Think DigitalGasoline

  2. #2
    Join Date
    Feb 2006
    Location
    Enschede, NL, EU
    Posts
    19
    Thanks
    1
    Qt products
    Qt3
    Platforms
    Unix/X11

    Default Re: QProcess start automaticaly needed application

    Why not let windows handle it?

    from a dos box you can do "start bla.xls" and windows will use whatever default program is associated with it... I'm not too familiar with win32 programming but I would think theres some sort of API call to handle that.

    At least it's not considered good design if your application needs to "know" the physical location of external apps. That's what default application bindings are for

Similar Threads

  1. Replies: 3
    Last Post: 20th November 2014, 07:10
  2. Qt Application + Web Integration -- Help needed
    By swamyonline in forum Qt Programming
    Replies: 0
    Last Post: 17th February 2009, 11:59
  3. Start Qt application as Windows Service
    By ^NyAw^ in forum Qt Programming
    Replies: 12
    Last Post: 10th May 2008, 17:23
  4. Questions about kill() and start() of QProcess
    By mp33919 in forum Qt Programming
    Replies: 5
    Last Post: 23rd June 2007, 13:00

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.