怎么在dll中声明全局变量?

liyuan00 2003-11-13 09:26:11
我写了一个asp组件,想在dll里面保存一些参数给每个实例共享,应该怎么声明全局变量?
...全文
89 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
bbscbb 2003-12-24
  • 打赏
  • 举报
回复
你的“全局变量”是相对于什么的啊?
Devlopered 2003-12-24
  • 打赏
  • 举报
回复
UP
zhuangbx220 2003-12-22
  • 打赏
  • 举报
回复
http://expert.csdn.net/Expert/TopicView1.asp?id=2588116

我的问题也是这样,结果变量值没有了,,,所有代码都在上面.
yanghai0437 2003-11-13
  • 打赏
  • 举报
回复
dll中的变量不能传递出的
library afeffect;

{ 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. }
{本动态链接库主要是用于对图像的特效处理。 目前还只能对24位位图进行处理,还没有加入对位图
格式不同的处理。
参考资料:VB6 图象处理开发与实例 (李兰友、万振凯等编著,电子工业出版社)
作者:yanghs
日期:2003-10-29
Email:yanghai0437@hotmail.com
}
uses
// ShareMem,
Windows,
SysUtils,
Classes,
Graphics,
Types;


var
PHOTO_WIDTH :Word; //捕获,处理,显示的图像的宽度
PHOTO_HEIGHT :Word; //捕获,处理,显示的图像的高度
iMotherBoardHeight :WORD; //模板高度
iInitialMotherBoardHeight :Word; //初始模板高度
hiflower 2003-11-13
  • 打赏
  • 举报
回复
建一个单元专门用于声明全局变量
hkbarton 2003-11-13
  • 打赏
  • 举报
回复
我曾写过一篇在dll中定义全局变量的,那就是使用内存映象文件,具体请看:
http://www.csdn.net/develop/read_article.asp?id=20538

1,593

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 网络通信/分布式开发
社区管理员
  • 网络通信/分布式开发社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧