在一个dll中,读取和写入注册表都没有问题,
释放dll也没有报错,
但是在关闭程序时报错。错误如下Runtime error 217 at 00402808请问如何解决。

解决方案 »

  1.   

    这个难说的要看具体代码的DLL中使用注册表是没有问题的http://lysoft.7u7.net
      

  2.   

    以下是建立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. 这个问题我也碰到过,不过很容易解决,按以下的方法就可以了!!
    共有三种解决问题的方法(可任选择一种):
    (1)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.
    如果你的DLL对外输出了以字符串作参数类型或返回值类型的过程或方法,ShareMem这个单元就必须包含在DLL库源文件和调用该DLL的工程源文件的uses子句中,并且一定要作为第一个被引用的单元。
    (2)To avoid using BORLNDMM.DLL, pass string information using PChar or ShortString parameters.
    为了避免调用BORLANDMM.DLL,使用PChar或者ShortString传递字符串信息
    (3)静态调用改为动态调用!
      

  3.   

    把用dll的地方去掉看看
    最好贴出代码
      

  4.   

    我的DLL对外接口没有String的参数和返回结果,
    现在已经好了。但我不知道如何好的。