你是说如何写可传递参数的DLL,还是想向已有的DLL传递参数。
1:编写函数时与不同函数一样建立参数接口啊。
2:要知道该DLL的函数调用说明。不过好多没有公开呀!

解决方案 »

  1.   

    可以啊,你的DLL不是有若干个接口吗,直接往里传就是的哦
      

  2.   

    不好意思,我没说清楚是我自己写的DLL,是关于输入的字符串合法性检查的。要向里面传两个字符串的参数,检查后返回一个0(不合法)或1(合法)的值具体如何做?
      

  3.   

    function CheckStr(str:string):Boolean;
      

  4.   

    function CheckStr(str1:string;str2:string):Boolean;export;
    begin
          if str1=str2 then  CheckStr:=true
                       else  CheckStr:=false;
    end;
    在用静态的调用dll方式调用即可!
      

  5.   

    最好用 pchar 或 shortString 来传递字符串参数。
    function FuncCheckString(str1,str2:pchar):integer;stdcall;
    begin
      ...........
      if 合法 then
         result := 1
      else
         result := 0;
    end;
    export
      FuncCheckString index 1;
      

  6.   

    楼上说的对用pchar类型可以被其他编程语言调用该dll!就听他的吧!
      

  7.   

    那我的调用代码应该如何将参数传给DLL里面的函数啊?我是动态装载DLL的
      

  8.   

    以下是delphi的help里关于动态装载DLL,并调用其中函数的例子原文,请参考:
    uses Windows, ...;
    type  TTimeRec = record
        Second: Integer;
        Minute: Integer;
        Hour: Integer;
      end;  TGetTime = procedure(var Time: TTimeRec);  THandle = Integer;var  Time: TTimeRec;
      Handle: THandle;
      GetTime: TGetTime;
      ...
    begin
      Handle := LoadLibrary('DATETIME.DLL');
      if Handle <> 0 then
      begin
        @GetTime := GetProcAddress(Handle, 'GetTime');
        if @GetTime <> nil then
        begin
          GetTime(Time);
          with Time do
            WriteLn('The time is ', Hour, ':', Minute, ':', Second);
        end;
        FreeLibrary(Handle);
      end;end;