我在Win98下用PChar来传递,但是该程序在Win2K下仍然会出现因为超过255长度而出错。
有什么解决方法吗?

解决方案 »

  1.   

    用AnsiString 或 WideString类型
      

  2.   

    dll传递是不能用String型的。
    想法片面了。
      

  3.   

    dll传递是不能用String型的,用Pchar.
    以下摘自delphi DLL向导
    { 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. }
      

  4.   

    WideString
    pchar可以到任意长度,没什么关系,这两个都是WINDOWS支持的