dev16 cxgrid 在DLL里报0地址错
dev16 cxgrid 在DLL里Form里使用,报0地址错,在EXE里正常。c++builder 的DLL报错,delphi也报错。
First chance exception at $09CE9B44. Exception class $C0000005 with message 'access violation at 0x09ce9b44: read of address 0x00000000'.
procedure TForm1.Button1Click(Sender: TObject);
begin
self.cxGrid1DBTableView1.CreateColumn;
end;
最终指向了 cxGridCustomTableView.pas
function TcxCustomGridTableView.CreateItem: TcxCustomGridTableItem;
begin
Result := GetItemClass.Create(Owner);
AddItem(Result);//error
end;
function TcxCustomGridTableItem.CanFilter(AVisually: Boolean): Boolean;
begin
Result :=
(esoFiltering in GetProperties.GetSupportedOperations) and FOptions.Filtering and
(not AVisually or GridView.OptionsCustomize.ItemFiltering and FOptions.FilteringPopup);
end;
DevExpress VCL\ExpressCore Library\Sources\dxCore.pas
//在这里看到dll的初始化和exe是分开的。exe直接调用,dll在InitializeList里。InitializeList是不是需要手动调用?
procedure TdxUnitsLoader.AddUnit(const AInitializeProc, AFinalizeProc: Pointer);
var
AProc: TdxProc;
begin
if AInitializeProc <> nil then
begin
AProc := AInitializeProc;
if not dxIsDLL then
begin
IsInitialized := True;
AProc;
end
else
InitializeList.Add(AInitializeProc);
end;
if AFinalizeProc <> nil then
FinalizeList.Add(AFinalizeProc);
end;
最后发现dxCore.pas文件里有2个函数,就是专门初始化的,在DLL里init和退出时finalize。
procedure dxInitialize; stdcall;
procedure dxFinalize; stdcall;
The dxInitialize & dxFinalize procedure must be used if you develop your project with DLLs.
But if you compile your DLL with active runtime packages, you don't need to call dxInitialize & dxFinalize manually.
原来的引用dxGDIPlusAPI修改为dxCore
原来的方法dxGdiPlusInitialize修改为dxInitialize
原来的方法dxGdiPlusFinalize修改为dxFinalize
Note that the dxInitializeGDIPlus and dxFinalizeGDIPlus functions have been moved to the dxCore unit. They were renamed to dxInitialize and dxFinalize respectively.
参考
http://www.cnblogs.com/jupt/p/3922935.html
官方
https://www.devexpress.com/Support/Center/Question/Details/Q470319/dynamic-loaded-dll-with-packages-av-s-in-dxcore
http://bbs.2ccc.com/topic.asp?topicid=414492
https://www.board4all.biz/threads/richeditcontrol-generates-an-error-is-this-a-bug.666000/
https://www.devexpress.com/Support/Center/Question/Details/Q387588/delphi-xe2-and-dxinitializegdiplus-problem
dev16 cxgrid 在DLL里报0地址错的更多相关文章
- sql server中调用c#写的dll里的方法
最近有一项目: 一超市管理系统单机版,运行在WIN2003+SQL2005上,每天超市关门都都会关电脑,现客户要新加功能,每天关门下班后回家可以上网查看超市管理系统的数据库里的相关数据,然后再做一些原 ...
- 远程线程注入DLL突破session 0 隔离
远程线程注入DLL突破session 0 隔离 0x00 前言 补充上篇的远程线程注入,突破系统SESSION 0 隔离,向系统服务进程中注入DLL. 0x01 介绍 通过CreateRemoteTh ...
- 在dll里malloc/new/cvCreate分配内存,在exe里free/Releases释放内存时会出错。
写了个程序,在DLL中用malloc分配了一块内存,但是在exe程序中释放,结果程序crash,原因就是:其原因可能是堆被损坏,这也说明 TestMySticker.exe 中或它所加载的任何 DLL ...
- kendo method:destroy 解决有些在kendo.all.js 的js 库里报错问题
首先,不得不承认,kendo UI 是个不错的东西,特别对于一个前端开发到行不足的程序猿来说.而在我们使用过程中貌似还是会遇到各种奇怪的问题.比如我们会经常用到对一些控件进行重赋值. destroy ...
- NX二次开发-C#使用DllImport调用libufun.dll里的UF函数(反编译.net.dll)调用loop等UF函数
在写这篇文章的时候,我正在头晕,因为下班坐车回家,有些晕车了.头疼的要死.也吃不下去饭. 版本:NX11+VS2013 最近这一年已经由C++过度到C#,改用C#做应用程序开发和NX二次开发. C#在 ...
- Ceph部署mon出现0.0.0.0地址
前言 最近在群里两次看到出现mon地址不对的问题,都是显示0.0.0.0:0地址,如下所示: [root@lab8106 ceph]# ceph -s cluster 3137d009-e41e-41 ...
- 问题-[Delphi]用LoadLibrary加载DLL时返回0的错误
问题现象:用LoadLibrary加载DLL一直返回0句柄,无法进行下一步操作,但同样的代码可以访问到别的DLL.问题处理:1.你加载的路径是不对的,一定要看好路径.2.你是在虚拟机中操作的DLL,因 ...
- 借助微软提供的url重写类库URLRewriter.dll(1.0)实现程序自动二级域名,域名需要泛解析
二级域名和系统中会员帐号自动关联,也就是系统中注册一个会员,会员自动就可以通过二级域名来访问,比如我的帐号是zhangsan,我在morecoder.com注册后,访问zhangsan.morecod ...
- unity3d MonoDevelop引用外部自定义dll文件报错:are you missing an assembly reference?
在unity3d 编辑器 MonoDevelop 中引用外部自定义dll文件报错:are you missing an assembly reference? 因为unity还停留在.NET Fram ...
随机推荐
- Maven打包将所有的依赖都打入
附上pom.xml <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www ...
- 利用cbmakegen导出Code::blocks的Makefile
首先到官网下载cbmakegen 官网地址:http://developer.berlios.de/projects/cbmakegen/ 也可通过我的百度网盘下载 [windows版本]地址:htt ...
- 不同三级域名与二级域名之间互相共享Cookie
当你在项目中遇到这样一个问题,有多个站点在多个二级级域名如果要实现各域名站点下的登录状态共享,那么最简单的方法就是共享Cookie. 首先声明几个概念,域名怎么去区分. 顶级域名:.com,.cn,. ...
- LinkedList的自定义实现
一.背景 LinkedList双向链表: 代码: Node.java: package com.cy.collection; public class Node { Node previous; // ...
- Jmeter(十四)Logic Controller 之 If Controller
If Controller---如果控制器:属于逻辑判断类型的组件,其实学过代码的都知道if--else,while等都是常用的逻辑判断关键词,Jmeter也提供了逻辑判断--If Controlle ...
- Android 按下home键,程序在后台运行,在设置中点击程序的启动时,会再次打开启动页的解决办法
在onCreate()方法中增加如下代码即可: if (!isTaskRoot()) { finish(); return; }
- third party sales process 继续说
Trading company: A vendor或production plant: B END Customer: C third party sales与individual purchasin ...
- java eclipse maven The superclass "javax.servlet.http.HttpServlet" was not found on the Java Build Path 解决方法
在eclipse 中使用maven 创建java web项目,启动服务器遇到提示:The superclass "javax.servlet.http.HttpServlet" w ...
- HTML中head与body标签
一 head内常用标签 1.meta相关 #1.指定字符集 <meta charset="gbk"> #2.页面描述 <meta name="Descr ...
- es6(12)--类,对象
//类,对象 { //基本定义和生成实例 class Parent{ //定义构造函数 constructor(name='QQQ'){ this.name=name; } } let v_paren ...