怎样在delphi 6中调用可执行文件和动态连接库

解决方案 »

  1.   

    可执行文件用SelffExecute(),加上ShellAPI单元
    也可以用WinExec(。。)
    动态连接库有相关的文章,网上很多,去搜搜吧,
      

  2.   

    //-------------- 运行FileName指定的文件,Parameters指定参数
    function RunFile(FileName:string; Parameters:string=''):Boolean;
    begin
      Result := ShellExecute(0, 'open', pchar(FileName), pchar(Parameters), '',
        SW_SHOWNORMAL) > 32;
    end;uses 加上ShellAPI
      

  3.   

    1、
    uses shellapi;procedure TForm1.Button1Click(Sender: TObject);
    begin
     shellexecute(handle,'open','c:\wybicon.exe',nil,nil,sw_shownormal);
    end;2、
    procedure TForm1.Button2Click(Sender: TObject);
    begin
        adoconnection1.connectionstring:=promptdatasource(handle,'');
    end;
      

  4.   

    非常感谢大家,告诉我怎样调用exe,请问有没有调用dll的?
      

  5.   

    这样调用DLL
    ======================
    1,首先在implemention下面声明你要调用的DLL中的函数,例如
    implementation
    {$R *.dfm}
    function ADD(a:integer;b:integer):integer;far external 'math.dll';
    //前面部分是函数原型,后面部分是DLL名称,记住要把DLL和EXE放到一个目录下
    2,在程序中使用该函数
    procedure TForm1.Button1Click(Sender: TObject);
    var:
       sum:integer;
    begin
      sum := ADD(strtoint(edit1.text),strtoint(edit2.text));//使用函数
      showmessage('函数的和是:'+inttostr(sum));
    end;