不会吧!
DLL中
function MyFun(var sFile,sKey: String):Integer;stdcall
beginend;exports
  MyFun;调用
function MyFun(var sFile,sKey: String):Integer;stdcall external 'MyDLL.DLL';

解决方案 »

  1.   

    楼上的,不行的。真的,我都试过。并且我需要写的是一个过程,可以不要求返回值的。象上面传递过去的sfile是一个字符串,我在动态链接库里面用了一个showmessage来跟踪却为空,否则就是一些不知道是什么的怪码。
      

  2.   

    不要用string,用pchar,如果非要用就要在工程前面加sharemem单元.
      

  3.   

    在dll中使用string好像要在前头uese一个单元 sharemem ?(不太记得了!),在向导生成的原文件中的一段文字就说了这点,否则会有问题。你也可把string改用pchar来试试,这样兼容性更好,C++中也可使用
      

  4.   

    每当你新建一个dll工程,delphi都会有这样一段说明.
     Important note about DLL memory management: ShareMem must be the
      first unit in your library's USES clause AND your project's (select
      Project-View Source) USES clause if your DLL exports any procedures or
      functions that pass strings as parameters or function results. This
      applies to all strings passed to and from your DLL--even those that
      are nested in records and classes. ShareMem is the interface unit to
      the BORLNDMM.DLL shared memory manager, which must be deployed along
      with your DLL. To avoid using BORLNDMM.DLL, pass string information
      using PChar or ShortString parameters.
      

  5.   

    zzllabc(龙) 能具体告诉怎么做吗。我都做昏了。能给个小例子吗。
      

  6.   

    加sharemem单元,最好用PChar,另外是不是你在调用时没分配足够的内存啊?