您的位置:首页 > 编程语言 > Delphi

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;
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: