本帖最后由 a549013598 于 2012-02-29 10:23:56 编辑

解决方案 »

  1.   

    楼主,IsRemote, IsOPen四中组合的情况你都试试,看看是否是外部引起另外,这个Dll就一个函数,你改写成exe执行下,看有木有问题。
    也可以断定进Dll单步调试下
      

  2.   

    导出函数不要用string类型的参数,改成PChar
    { 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. }
      

  3.   

    问题找到了 也是 2楼说的 ShareMem 我用了 貌似不管用,后来改成了 ShortString 就OK了
      

  4.   

    在DLL中参数建议不要用string类型,采用PCHAR指针是比较好的方法,这样的话被其它程序语言调用时,容易出问题的。
      

  5.   


    楼主 ,ShareMem单元 要在动态库和引用动态库的单元中都要 包含!而且是在第一个引用! 不知楼主是否只是在动态库中 unit shareMem 了!