当前位置:主页>delphi技巧/代码下载> 文章内容

delphi调用bcb的dll问题(200分送上)

发布时间:2010-04-30 | QQ免费站
1楼: 怎樣以這個地址開啟程式:C:\WINDOWS\AppPatch\AppLoc.exe “L:\XYOnline-2.0.100\xy2.exe“ “/L0804“ 其中L:\XYOnline-2.0.100\xy2.exe我是用LabeledEdit4.Text自行輸入的.... 以下的語句為什麼開啟不了.... ShellExecute(Handle, ‘open‘, PChar(‘C:\WINDOWS\AppPatch\AppLoc.exe “‘+LabeledEdit4.Text+‘“ “/L0804“‘), nil , Pchar(‘‘) , SW_SHOW); 請大家幫幫我呀 字串2

2楼: CmdFileName:=PChar(‘C:\WINDOWS\AppPatch\AppLoc.exe “‘+LabeledEdit4.Text+‘“ “/L0804“‘),再引用试试。

字串8

3楼: CmdFileName:=PChar(‘C:\WINDOWS\AppPatch\AppLoc.exe “‘+LabeledEdit4.Text+‘“ “/L0804“‘); ShellExecute(Handle, ‘open‘, PChar(CmdFileName), nil , nil , SW_SHOW); 這樣還是不可以呢.............
字串8

4楼: 单步调试看看CmdFileName的值是不是你要的

字串4

5楼: 我連用這樣子也不行........ ShellExecute(Handle, ‘open‘, PChar(‘C:\WINDOWS\AppPatch\AppLoc.exe “L:\XYOnline-2.0.100\xy2.exe“ “/L0804“‘), nil ,nil , SW_SHOW);

字串7

6楼: 我用edit.text單步調了一下....出的結果是我要的...... 我用那結果在windows 的 run 里運行可以開啟的......

字串4

7楼: 你这个调用一看就知道不对了, AppLoc.exe后面参数不应那样写 好好看下调用的原型函数 ShellExecute( HWND hwnd, // handle to parent window LPCTSTR lpOperation, // pointer to string that specifies operation to perform LPCTSTR lpFile, // pointer to filename or folder name string LPCTSTR lpParameters, // pointer to string that specifies executable-file parameters LPCTSTR lpDirectory, // pointer to string that specifies default directory INT nShowCmd // whether file is shown when opened );
字串2

8楼: 参数应该写在lpParameters那里 字串4

9楼: 這個調用是對的...
字串4

10楼: LPCTSTR lpParameters, // pointer to string that specifies executable-file parameters 启动参数写在这里 字串9

11楼: 多人接受答案了。

字串2