關於錯誤Access Violation和too many consecutive exceptions 解決方案

來源:互聯網
上載者:User

“如果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

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.