中国IT动力,最新最全的IT技术教程
最新100篇 | 推荐100篇 | 专题100篇 | 排行榜 | 搜索 | 在线API文档 | 网通镜像
首 页 | 程序开发 | 操作系统 | 软件应用 | 图形图象 | 网络应用 | 精文荟萃 | 教育认证 | 硬件维护 | 未整理篇 | 站长教程
ASP JS PHP工程 ASP.NET 网站建设 UML J2EESUN .NET VC VB VFP 网络维护 数据库 DB2 SQL2000 Oracle Mysql
服务器 Win2000 Office C DreamWeaver FireWorks Flash PhotoShop 上网宝典 CorelDraw 协议大全 网络安全 微软认证
硬件维护  CPU  主板  硬盘  内存  显卡  显示器  键盘鼠标  声卡音箱  打印机  机箱电源  BIOS  网卡  C#  Java  Delphi  vs.net2005
  当前位置:> 程序开发 > 编程语言 > 综合其它
当dll使用静态RTL时关于内存管理的重要说明--BCB中
作者:未知 时间:2005-07-27 23:25 出处:CSDN 责编:chinaitpower
              摘要:当dll使用静态RTL时关于内存管理的重要说明--BCB中
//---------------------------------------------------------------------------
// Important note about DLL memory management when your DLL uses the
// static version of the RunTime Library:
//
// If your DLL exports any functions that pass String objects (or structs/
// classes containing nested Strings) as parameter or function results,
// you will need to add the library MEMMGR.LIB to both the DLL project and
// any other projects that use the DLL. You will also need to use MEMMGR.LIB
// if any other projects which use the DLL will be performing new or delete
// operations on any non-TObject-derived classes which are exported from the
// DLL. Adding MEMMGR.LIB to your project will change the DLL and its calling
// EXE's to use the BORLNDMM.DLL as their memory manager. In these cases,
// the file BORLNDMM.DLL should be deployed along with your DLL.
//
// To avoid using BORLNDMM.DLL, pass string information using "char *" or
// ShortString parameters.
//
// If your DLL uses the dynamic version of the RTL, you do not need to
// explicitly add MEMMGR.LIB as this will be done implicitly for you

当dll使用静态RTL时关于内存管理的重要说明:
  如果你的dll提供了参数中或返回值中有String对象(或包含String对象的类或结构体)
的输出函数,你必须加载MEMMGR.LIB到你的dll工程及调用dll的工程。
  还有,如果调用dll的工程new或者delete了任何该dll提供的非TObject子孙类,也需要加载MEMMGR.LIB。
  加载MEMMGR.LIB会使得dll及其调用者使用BORLNDMM.DLL作为他们的内存管理器。
所以,你需要把BORLNDMM.DLL和你的dll放在一起发布。
  改用“char *”或者ShortString做参数可以避免BORLNDMM.DLL的使用。
  如果你的dll使用动态RTL,你不需要显式的加载MEMMGR.LIB,BCB隐式的为你做了此工作。
关闭本页
 
首页 | 投资与合作 | 服务条款 | 隐私政策 | 收藏本站 | 设为首页 | 新用户注册 | 免责声明 | 使用帮助
Copyright ©2005-2008 chinaitpower.com All rights reserved. www.chinaitpower.com 版权所有