读书人

在DLL中调用EXE,该如何处理

发布时间: 2012-03-02 14:40:28 作者: rapoo

在DLL中调用EXE

Delphi(Pascal) code
function GetController:TForm1;stdcall;begin  with TForm1.Create(nil) do  try    Show;  except    Free;  end;end;exports GetController;


现在想用上面的这个函数调用某个文件夹下面的A.EXE,请问应该怎么做?



[解决办法]
ShellExecute,在ShellApi单元中
[解决办法]
winexec ?
有试过这个函数吗?
[解决办法]
在DLL中和EXE中调用外部程序方法相同
DLL
Delphi(Pascal) code
procedure GetController; stdcall;begin  ShellExecute(0, 'open', 'calc.exe', nil, nil, SW_SHOWNORMAL);end;exports  GetController; 

读书人网 >.NET

热点推荐