调用DLL窗体 cannot assign a TFont to a TFont 问题

来源:互联网 发布:未来软件官网 编辑:程序博客网 时间:2024/05/17 13:09
把系统的graphics.pas拷贝到自己的工程目录,修改TCanvas.SetFont函数 
procedure TCanvas.SetFont(Value: TFont); 
begin 
  FFont.Assign(Value); 
end; 

给上面的代码加上 try..except保护,编程如下: 
procedure TCanvas.SetFont(Value: TFont); 
begin 
  try 
    FFont.Assign(Value); 
  except 
  end; 
end; 

然后在DLL工程中引入我们修改好的文件,重新编译DLL,该提示不会再出现,至于有什么后遗症,暂时未知。
0 0
原创粉丝点击