登录
首页 » Delphi VCL » 嘿嘿,大侠看到不要见笑呀... 大家都知道使用DLL的好处.于是我就想把FORM封装到DLL里面去. 到网上找,发现是MDI和模式窗体的,非模式的也有...

嘿嘿,大侠看到不要见笑呀... 大家都知道使用DLL的好处.于是我就想把FORM封装到DLL里面去. 到网上找,发现是MDI和模式窗体的,非模式的也有...

于 2022-01-31 发布 文件大小:63.31 kB
0 215
下载积分: 2 下载次数: 1

代码说明:

嘿嘿,大侠看到不要见笑呀... 大家都知道使用DLL的好处.于是我就想把FORM封装到DLL里面去. 到网上找,发现是MDI和模式窗体的,非模式的也有很多问题.便想自己解决这个问题. 原来是用DLL创建一个对象返回,但发现有很多的问题. 想了半天就去寻根问柳吧. 找到了类. 我就想把类封装进DLL,到时简单的返回一个类,然后在主程序里操作不就简单了? 找了半天发现了TFormClass,于是试了试从DLL导出来,像一般的程序一样创建窗体发现成功. 接着我又想看看其他的类是不是也能这样,就拿TFrame来实验. function GetDllFrameClass():TFrame stdcall 第一次是这样声明的,失败.奇怪?! 试了好多次都不行,就想到了TFormClass(Ctrl+左键),进去看看,发现是这样声明的. TFormClass = class of TForm 哎呀,恍然大悟!! class(TFrame) 是声明一个类, 这个类继承了TFrame类 f: TFrame 是一个对象 class of TFrame 声明的是类类型, f:TFrameClass 是一个类. function GetDllFrameClass():TFrame 返回就不是类而是对象了,照TFormClass修改后TFrameClass = class of TFrame 运行...成功,

下载说明:请别用迅雷下载,失败请重下,重下不扣分!

发表评论

0 个回复

  • TxQuery is created and owned by Alfonso Moreno. He has stopped the development o...
    TxQuery is created and owned by Alfonso Moreno. He has stopped the development of TxQuery for years. However, there are many Delphi developers still using TxQuery. A barrier for TxQuery migrating to Delphi 2009 and 2010 is the introduction of Unicode.
    2023-06-19 22:30:03下载
    积分:1
  • 得到主要名及其IP地址
    得到主要名及其IP地址-be the main name and IP address.
    2022-01-31 13:03:20下载
    积分:1
  • Canvas打印内容
    Canvas打印内容-Canvas Print content
    2023-01-20 10:15:04下载
    积分:1
  • 如何在delphi下制作IntraWeb 报表
    如何在delphi下制作IntraWeb 报表-how the statements produced IntraWeb
    2022-05-30 13:16:40下载
    积分:1
  • TMS组件包V5.0包括超过280 Delphi和C++ Builder设计…
    TMS Component Pack V5.0包含了超过 280 个为 Delphi 以及 C++Builder 设计的 TMS 生产控件,省钱又省时。 本版本支持以下 IDE: Delphi 5,6,7,2005 C++Builder 5,6 BDS 2006 (Delphi 2006, C++Builder 2006) RAD Studio 2007 (Delphi 2007, C++Builder 2007) RAD Studio 2009 (Delphi 2009, C++Builder 2009)-TMS Component Pack contains more than 280 for Delphi and C + + Builder designed TMS production control, also saving time and money. This version supports the following IDE: Delphi 5,6,7,2005 C + + Builder 5,6 BDS 2006 (Delphi 2006, C + + Builder 2006) RAD Studio 2007 (Delphi 2007, C + + Builder 2007) RAD Studio 2009 ( Delphi 2009, C + + Builder 2009)-TMS Component Pack V5.0 includes more than 280 for Delphi and C++ Builder designed TMS production control, save money and save time. This version supports the following IDE: Delphi 5,6,7,2005 C++ Builder 5,6 BDS 2006 (Delphi 2006, C++ Builder 2006) RAD Studio 2007 (Delphi 2007, C++ Builder 2007) RAD Studio 2009 ( Delphi 2009, C++ Builder 2009)-TMS Component Pack contains more than 280 fo
    2023-08-26 11:50:06下载
    积分:1
  • 一个做界面的东东(delphi)
    一个做界面的东东(delphi)-an interface so Wanton (delphi)
    2022-03-06 08:11:38下载
    积分:1
  • VCLSkin5.30 FS支持最新Delphi2010正式版版本。
    VCLSkin5.30 FS支持最新Delphi2010正式版版本。-VCLSkin5.30 FS supports the latest version of the final version Delphi2010.
    2023-06-22 09:45:04下载
    积分:1
  • 一个有关Delphi 中 UDP协议的实列
    一个有关Delphi 中 UDP协议的实列-Delphi in a UDP protocol is listed
    2023-05-02 10:55:04下载
    积分:1
  • 开发数据库修复工具修复损坏的数据库文件
    delphi开发的db数据库修复工具,能修复损坏的db文件-delphi development db database repair tool to repair a damaged db file
    2022-01-26 19:37:46下载
    积分:1
  • Here are a few examples of Delphi can be transported to work.
    这里给出了几个Delphi的实例,都能运行得通。-Here are a few examples of Delphi can be transported to work.
    2023-02-27 01:50:09下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载