码迷,mamicode.com
首页 > 数据库 > 详细

关于错误Access Violation和too many consecutive exceptions 解决方法

时间:2016-01-19 19:10:38      阅读:384      评论:0      收藏:0      [点我收藏+]

标签:

“如果DLL中用到了DELPHI的string类型,则DLL和主程序中都需要加上ShareMem”。DLL项目加ShareMem这个我知道,但主程序中也要加?这我就不明白了,为什么以前不加的时候没这个问题呢?加就加吧,果然加上后一点问题都没有。唉,真是搞不明白。最后在新建DLL项目时,DELPHI有一段注释给了我答案。

 

library MyDll;

 

{ 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. }

uses
  ShareMem,
  SysUtils,
  Controls,
  Forms;

{$R *.res}

 

begin

end.

 

http://blog.csdn.net/hhf383530895/archive/2009/11/24/4861309.aspx

关于错误Access Violation和too many consecutive exceptions 解决方法

标签:

原文地址:http://www.cnblogs.com/tc310/p/5142851.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!