delphi也不是很熟,特請各位高手指點,謝謝大家!1,我看到供應商有提供結構的定義:Type Params=record
  Port:array[0..2] of char;
  CtrlID:array[0..2] of char;
  Param:array[0..1023] of char;
  IPPort:array[0..5] of char;
  IPAddr:array[0..15] of char;
end;請問結構定義要放在下面哪個位置:unit Main;interfaceuses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, StdCtrls;type
  TForm1 = class(TForm)
    Button1: TButton;  private
    { Private declarations }
  public
    { Public declarations }
  end;var
  Form1: TForm1;
implementation{$R *.dfm}end.2,他的dll文件我怎樣引用

解决方案 »

  1.   

    uses下面
    调用dll里面的函数例如
    function      ...   ;stdcall; external '...dll';
      

  2.   

    放在var Form1: TForm1;的前面
      

  3.   

    那函數定義在哪?我的定義在這,但出錯:
    type
      TForm1 = class(TForm)
        Button1: TButton;
        function      ...   ;stdcall; external '...dll';//定義在這出錯  private
        { Private declarations }
      public
        { Public declarations }
      end;
      

  4.   

    晕啊
    放在implementation下面
      

  5.   

    function      ...   ;stdcall; external '...dll';
    可以定义在{$R *.dfm}后面的
      

  6.   

    Params=record
      Port:array[0..2] of char;
      CtrlID:array[0..2] of char;
      Param:array[0..1023] of char;
      IPPort:array[0..5] of char;
      IPAddr:array[0..15] of char;
    end;
    這一段放在TYPE後面就可以了,DLL就不好說了,在網上找一下吧,好多的,基本上就兩種方法1是直接引用
    2是動態調用
      

  7.   

    還有dll文件要放在哪文件夾下面才可以?
      

  8.   

    定義之後,我怎樣去用這個函數?
    xxx()
      

  9.   

    定義之後,我怎樣去用這個函數?
    xxx()
    -----------
    传参数给它小伙子,找点书看看撒