dlls文件要用到被调用程序中的edit1.text中的内容,那么怎么把调用程序中的edit1.text中的内容传递给dlls文件?
那位高手能帮一下,快崩溃了!
最好能给个具体的例子?

解决方案 »

  1.   

    声明
    Procedure test(s:Pchar); stdcall; external 'your.dll';
    调用
    test(PChar(edit1.text);
      

  2.   

    Type TMyProc = Procedure (Param:Pchar ) ;stdcall;Var
      MyProc: TMyProc;
      handle: tHandle;
    Begin
    try
      handle := LoadLibrary(PChar('your.dll'));
      if handle <> 0 then 
        @MyProc := GetProcAddress(handle, PChar('test'));
      if Assigned(MyProc) then 
        MyProc(Pchar(edit1.text));
      else
        RaiseLastWin32Error;
    finally
     FreeLibrary(handle); 
    end;