_TLB 中自动生成的代码与生成该代码的 DLL 文件之间的关系
我有一个 DLL,我使用 Delphi 6 中项目下的导入类型库功能将其作为类型库导入到项目中。我最近对 _TLB.pas 文件和生成它的 DLL 之间的关系感到好奇。 _TLB.pas 文件是用来代替库的还是仅当我有代码接口时才使用它?关于 _TLB.pas 中的代码如何与生成它的 DLL 一起工作,还有哪些其他信息会更好?
I have a DLL which I am importing to the project as a type library using the Import Type Library functionality under Project in Delphi 6. I recently became curious about what the relationship between the _TLB.pas file and the DLL it was generated from are. Is the _TLB.pas file used in place of the library or only if I have my code interface with it? What other information would be good to know about how the code in the _TLB.pas works with the DLL it was generated from?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
_TLB.pas 文件是从 DLL 生成的;它是基于 Pascal 的接口,您的项目将使用它来调用 DLL 中的功能。
在编译时您将需要 _TLB.pas;在运行时你需要DLL。
the _TLB.pas file is generated from the DLL; it is the Pascal based interface that your project will use to call functionality in the DLL.
At compile time you will need the _TLB.pas; at run-time you need the DLL.
.pas 文件是从类型库生成的,该类型库通常包含在 COM DLL 中。
.pas 文件定义 COM DLL 的接口。带有嵌入式类型库的 COM DLL 具有自描述接口。您仍然需要文档来了解接口和方法的作用以及参数的使用方式。但您不需要自己编写样板接口代码。
当 COM DLL 具有嵌入式类型库时,您可以使用您选择的编程语言(而不仅仅是 Delphi)创建导入单元。
如果您想了解 COM,没有比 Don Box 的 Essential COM,我读过的最好的计算书籍之一。
The .pas file is generated from the type library, which is typically contained within the COM DLL.
The .pas file defines the interface to the COM DLL. COM DLL's which come with embedded type libraries have self-describing interfaces. You still need documentation to understand what the interfaces and methods do, and how the parameters are used. But you don't need to write the boiler plate interface code yourself.
When a COM DLL has an embedded type library, you can create import units in your programming language of choice, not just Delphi.
If you want to know COM there is no better reference than Don Box's Essential COM, one of the finest computing books I have ever read.