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

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

于 2022-01-31 发布 文件大小:63.31 kB
0 190
下载积分: 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 个回复

  • Delphi编写的充电器上位机程序含代码
    Delphi编写的充电器上位机程序含代码-Delphi prepared charger PC program containing the code
    2023-06-15 11:15:17下载
    积分:1
  • Rx库中包含了大量的组件,用于Borla对象和例程…
    RX Library contains a large number of components, objects and routines for Borland Delphi with full source code. This library is compatible with Borland Delphi 1, 2, 3, 4 and Borland C++ Builder 1 and 3.
    2023-08-22 01:10:04下载
    积分:1
  • 俄罗斯出品的一个高效字符串操作的函数单元,比delphi自带的函数效率高...
    俄罗斯出品的一个高效字符串操作的函数单元,比delphi自带的函数效率高
    2022-03-24 04:25:29下载
    积分:1
  • 查询等级考试成绩的源码,使用报表类组建
    查询等级考试成绩的源码,使用报表类组建-grading test scores for the source, the use of such statements form
    2022-05-25 05:14:42下载
    积分:1
  • Delphi source code documantor
    Delphi source code documantor
    2022-04-16 00:10:34下载
    积分:1
  • 把IP地址转化成电脑名称 在D7 中 windows xp下通过
    把IP地址转化成电脑名称 在D7 中 windows xp下通过-IP address of the computer name into
    2022-11-01 18:45:03下载
    积分:1
  • 编程技能集(23
    Delphi2005 B/S程序设计技巧集(23--28) 现在delphi 2005 B/S的书籍资料太少,几乎没有可参考的资料,这在一定程度上限制了delphi 2005的使用,相反C#,ASP的书籍资料到处都是。通过几个月的学习也算是总结了一点经验,从现在起我将陆续将ASP和C#的例子、技巧翻译到delphi 2005下面,希望对大家的学习和工作有帮助,毕竟.Net是一种发展趋势。我将不定期写新的内容,同时,如果你在工作或学习中有什么问题,我也会将问题加入本篇文章,另外,一个人的能力毕竟有限,也希望大家共同来解决问题。 宋雨炫 -Delphi B/S programming skills sets (23-- 28) is now delphi 2005 B/S books so little information, almost no reference to the information, This, to a certain extent, limit the use of Delphi 2005, C# contrary, ASP information books are everywhere. Through several months of learning is also summed up the experiences that from now on I will continue, ASP and C# example, delphi translation skills to below 2,005, we hope to study and work there to help, After all. Net is a development trend. From time to time I will write the new content, and if you work or study any problem, I will also take the issue into this article, in addition to the ability of a person is limited, I hope we can jointly to solve the problem. SONG X
    2022-01-27 22:34:33下载
    积分:1
  • 快速repoet
    Fast Repoet
    2022-01-24 12:49:16下载
    积分:1
  • 根据定制的数据绘图形,可以绘制胎儿生长曲线,或股票走执曲线图...
    根据定制的数据绘图形,可以绘制胎儿生长曲线,或股票走执曲线图-According to custom data type mapping, you can draw fetal growth curve, or stocks they follow curve
    2022-06-18 19:57:59下载
    积分:1
  • Delphi COM插件
    delphi com addin
    2022-11-17 06:35:04下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载