Delphi疑难问题整理!!!
2018-03-05 14:57
316 查看
1.Dll调用时报错,例如:
TGetResPrice = function(var AName: string; AFileName: string): TResourceRecArray; stdcall;
var
LFunction: TGetResPrice;
调用:
@LFunction := GetProcAddress(LDllHandle, ResPriceLoad_FuncName);
if Assigned(LFunction) then
LResc := LFunction(AName, AFileName);
dll实现:
function GetResPriceInfo(var AName: string; AFileName: string): TResourceRecArray; stdcall;
begin
。。。。。
end;
有可能是参数缺少或不一致,两者必须一致!
2.DLL释放时报错:
FreeLibrary(LDllHandle);
有可能是调用和DLL的两者调用FastMM不一致,一个引用了,另外一个没有引用;
uses
FastMM4,
ExceptionLog,
SysUtils,
Classes,
TableTypes,
CoDialogs,
PriceLoad in '..\Source\PriceLoad.pas';
另外一个可能就是两者引用包不一样,Component--Install Packages---勾选Build with runtime packages;
3.TAppBuilder.CheckDog 提示注册类已经存在:DPR文件引用包的问题
例如:A class named TcxRect already exists
在EXE+DLL架构中,多个使用DEV控件的DLL中出现“A class named TcxRect already exists”错误。把cxLibraryVCLD7.bpl拷到运行目录下,并且在工程的options中,把cxLibraryVCLD7.bpl加入到runtime packages中,可解决“A class named TcxRect already exists”错误。
类似的错误,一般都是缺少运行时包所致,仔细排查都能解决。
Qd8.exe 加载modArchRptData.dll,在QD8.exe---Component--Install Packages---Build with runtime packages --- 后面添加cxLibraryVCLD7;
TGetResPrice = function(var AName: string; AFileName: string): TResourceRecArray; stdcall;
var
LFunction: TGetResPrice;
调用:
@LFunction := GetProcAddress(LDllHandle, ResPriceLoad_FuncName);
if Assigned(LFunction) then
LResc := LFunction(AName, AFileName);
dll实现:
function GetResPriceInfo(var AName: string; AFileName: string): TResourceRecArray; stdcall;
begin
。。。。。
end;
有可能是参数缺少或不一致,两者必须一致!
2.DLL释放时报错:
FreeLibrary(LDllHandle);
有可能是调用和DLL的两者调用FastMM不一致,一个引用了,另外一个没有引用;
uses
FastMM4,
ExceptionLog,
SysUtils,
Classes,
TableTypes,
CoDialogs,
PriceLoad in '..\Source\PriceLoad.pas';
另外一个可能就是两者引用包不一样,Component--Install Packages---勾选Build with runtime packages;
3.TAppBuilder.CheckDog 提示注册类已经存在:DPR文件引用包的问题
例如:A class named TcxRect already exists
在EXE+DLL架构中,多个使用DEV控件的DLL中出现“A class named TcxRect already exists”错误。把cxLibraryVCLD7.bpl拷到运行目录下,并且在工程的options中,把cxLibraryVCLD7.bpl加入到runtime packages中,可解决“A class named TcxRect already exists”错误。
类似的错误,一般都是缺少运行时包所致,仔细排查都能解决。
Qd8.exe 加载modArchRptData.dll,在QD8.exe---Component--Install Packages---Build with runtime packages --- 后面添加cxLibraryVCLD7;
相关文章推荐
- delphi中通过http控件上载文件的问题(紧急) 整理的CSDN 帖子
- java中常见的一些疑难问题整理
- delphi中Webbrowser疑难问题集锦
- ubuntu14.04 疑难问题整理
- 从今天起,开始写bolg!整理日常中的疑难问题,欢迎关注
- Ajax乱码问题整理
- 关于ORA-00907: missing right parenthesis问题整理
- FastReport问题整理
- delphi低版本升高版本问题
- [导入]发布本人整理的面试问题大全,为准备找工作的同行们尽一份力!希望大家多补充或回答!
- java中文乱码问题解决方案整理
- IT form整理 java应该注意的问题2
- IT form整理 java应该注意的问题3(异常+多线程)
- pageoffice相关问题整理
- 异或问题整理(高斯消元留坑)
- Fragment 使用ViewPager问题整理
- Jboss部署问题整理
- 系列nc问题整理
- matlab画图的一些问题【归纳整理前辈的一些东西】