Delphi DLL中对主程序某控件赋值问题

guangming84 2009-04-07 11:18:41
在DLL中,
Text:String;
cxTreeList.FocusedNode.Texts[col] := Text;
赋值后出现内存访问冲突,
其中cxTreeList为主程序的tcxTreeList对象, col为相应的列下标。
...全文
75 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
guangming84 2009-04-07
  • 打赏
  • 举报
回复
这个值是在DLL内部定义的。。不是从外部传入,应该可以赋值的,,而且值是可以赋给了,但是控件刷新时就出现内存访问冲突了!
zywuhao 2009-04-07
  • 打赏
  • 举报
回复
{ 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. }
以上是建立DLL工程时候的说明、
最后一句说,给Dll传值的时候只能用Pchar和ShortString类型参数。
避免使用BORLNDMM.DLL ,传递字符串信息使用PChar或ShortString参数。

5,392

社区成员

发帖
与我相关
我的任务
社区描述
Delphi 开发及应用
社区管理员
  • VCL组件开发及应用社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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