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

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

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

  • 学士课程设计技能集(1
    Delphi2005 BS程序设计技巧集 (1-3) 现在delphi 2005 B/S的书籍资料太少,几乎没有可参考的资料,这在一定程度上限制了delphi 2005的使用,相反C#,ASP的书籍资料到处都是。通过几个月的学习也算是总结了一点经验,从现在起我将陆续将ASP和C#的例子、技巧翻译到delphi 2005下面,希望对大家的学习和工作有帮助,毕竟.Net是一种发展趋势。我将不定期写新的内容,同时,如果你在工作或学习中有什么问题,我也会将问题加入本篇文章,另外,一个人的能力毕竟有限,也希望大家共同来解决问题。 宋雨炫-Delphi BS program design skills sets (1-3) 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 Xuan
    2022-05-16 22:31:07下载
    积分:1
  • FastReport2.52 versions.
    FastReport2.52 版本不同-FastReport2.52 versions.
    2022-02-26 17:46:06下载
    积分:1
  • 类似IE的前进、后退、历史记录 功能 (VCL组件) delphi语言编写
    类似IE的前进、后退、历史记录 功能 (VCL组件) delphi语言编写-similar IE advance, retreat, the historical record function (VCL) delphi language
    2022-07-01 15:05:04下载
    积分:1
  • delphi7 notepad
    利用DELPHI7来编写的一个记事本。不是非常的完善,但基本的功能都实现了。-delphi7 notepad
    2023-04-26 06:20:03下载
    积分:1
  • USE, the Unicode Syntax Edit is an edit control for Delphi, with syntax highligh...
    USE, the Unicode Syntax Edit is an edit control for Delphi, with syntax highlighting and WideString/Unicode support. This edit control comes with highlighter classes for Delphi, C/C++, HTML, SQL and others.
    2022-09-30 02:50:03下载
    积分:1
  • 一个采用delphi开的数库系统,经测试功能奇全,数据也一起上传了上来
    一个采用delphi开的数库系统,经测试功能奇全,数据也一起上传了上来-Using delphi opened a few library systems, by testing the whole Qi, together with data uploaded onto
    2023-06-22 03:45:05下载
    积分:1
  • delphi7,源代码 主要的是进行DELPHI7的源代码进行管理和维护
    delphi7,源代码 主要的是进行DELPHI7的源代码进行管理和维护-delphi7, source code is a major Delphi7 source code management and maintenance
    2022-07-06 23:05:53下载
    积分:1
  • 通过Delphi编程实现将多张图片进行合成的程序源代码
    通过Delphi编程实现将多张图片进行合成的程序源代码-Delphi programming through multiple pictures of the synthesis
    2022-06-29 14:29:30下载
    积分:1
  • 动态改变PANEL的演示代码
    动态改变PANEL的演示代码-dynamic change PANEL demo code
    2022-01-25 21:43:44下载
    积分:1
  • 使用def开发的USB驱动源代码奉献给各位
    使用def开发的USB驱动源代码奉献给各位-Def developed using the USB driver source code dedicated to you
    2022-03-12 23:14:19下载
    积分:1
  • 696516资源总数
  • 106914会员总数
  • 0今日下载