在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;