可以的,很正常
DLL:
library dllTest;
uses
SysUtils,
Classes,shellapi;
const SW_SHOWNORMAL=1;
{$R *.RES}
procedure MyExe;stdCall;
begin
ShellExecute(0,'open',pchar('d:/temp/delphi/test.exe'),PChar('http://nettv.diy.163.com/bug.htm'),nil,SW_SHOWNORMAL)
end;
exports
MyExe;
end.
DLL调用的EXE能接受到参数:Test.exe
//cmdline 和 ParamStr(1) 中都有参数
procedure TForm1.Button1Click(Sender: TObject);
var
i: Integer;
begin
showmessage(inttostr(ParamCount));
showmessage(cmdline);
for i := 0 to ParamCount do showmessage(ParamStr(i));
end;
另一个程序,调用DLL中的EXE,Project1.exe
procedure MyExe;stdcall;external 'd:/dllTest.dll';
procedure TForm1.Button1Click(Sender: TObject);
begin
myexe;
end;