dll中的Delphi表单 [英] Delphi forms in dlls

查看:61
本文介绍了dll中的Delphi表单的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

将具有完整功能的窗体放在dll中是个好主意.并且主应用程序将调用返回表单对象的dll函数.

Is it good idea to put Forms that have complete functionality in dll. And main app will invoke dll function that returns form object.

推荐答案

在Delphi中,可接受的方法是使用包而不是DLL.

The accepted way to do this in Delphi is to use packages rather than DLLs.

包本质上是DLL,但具有特定于Delphi的功能,该功能允许VCL对象跨包边界使用.

Packages are essentially DLLs but with Delphi specific capabilities that allow VCL objects to be used across package boundaries.

尝试使用DLL执行此操作将导致程序包处理各种问题.软件包的缺点之一是,所有模块都必须使用相同版本的Delphi 进行编译.但是,如果要跨模块边界共享对象,则使用DLL也会遇到相同的限制.

Trying to do this with DLLs will lead to a variety of problems that packages deal with. One downside of packages is that all modules must be compiled with the same version of Delphi. But if you are wanting to share objects across module boundaries then you would face the same restriction if you used DLLs.

Delphi文档涵盖了软件包.

The Delphi documentation has extensive coverage of packages.

话虽如此,我想补充一点,如果您可以将所有代码放入单个模块(.exe或.dll)中,那么它的确会使工作变得更加简单.

Having said all that, I would add that if you can put all your code into a single module (.exe or .dll) then it does make life a lot simpler.

这篇关于dll中的Delphi表单的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆