2012-03-30 28 views
0

任何人都可以給我解決方案如何通過參數調用另一個應用程序。以及如何開始由參數調用的過程。在VB代碼的情況是:通過Qt參數調用另一個應用程序

啓動程序由PARAM:

Sub main() 
    if command$ <> vbnullstring then ... running the process 
end sub 

通話過程PARAM:

Dim shell As wshShell 
Dim lngReturnCode As Long 
Dim strShellCommand As String 

Set shell = New wshShell 

strShellCommand = "C:\Program Files\My Company\MyProg.exe " & _ 
"-Ffoption -Ggoption" 

lngReturnCode = wshShell.Run(strShellCommand, vbNormalFocus, vbTrue) 

我索裏對我的英語不好,我需要的源代碼由QT。感謝前^^

+1

你看所有的QProcess中的文檔?你有什麼嘗試? – Mat 2012-03-30 12:05:39

+0

啊,我看到如何運行一個進程。 <=解決了。感謝的@Mat 現在,我想了解如何通過參數啓動一個進程? – user1276647 2012-03-30 12:54:02

+0

繼續閱讀該文檔,嘗試一下,然後編輯此問題,並使用迄今爲止的代碼進行編輯。 – Mat 2012-03-30 12:55:49

回答

1

的只需提供一個QStringList中的arguements看到http://doc.qt.nokia.com/4.7-snapshot/qprocess.html#details

 QObject *parent; 
    ... 
    QString program = "./path/to/Qt/examples/widgets/analogclock"; 
    QStringList arguments; 
    arguments << "-style" << "motif"; 

    QProcess *myProcess = new QProcess(parent); 
    myProcess->start(program, arguments); 
相關問題