PDA

View Full Version : QProcess start automaticaly needed application



raphaelf
16th February 2006, 11:49
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?


QProcess *p = new QProcess();
p->addArgument("D:\\Apps\\Microsoft Office\\Office10\\excel.exe");
p->addArgument("W:\\inventar\\Reports\\" + fileName);

p->start();


THX

ReilenBlaeyze
16th February 2006, 14:11
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 :)