简体   繁体   中英

How do I create a Delphi Class library

What are some options for creating a Delphi Class library?

I have a class TWidget that is used in multiple programs. Currently, I have each program link to \\common\\UnitWidget.pas source code file. However when TWidget changes, I am forced to recompile and rerelease all programs referencing it.

I am not very familiar with C#, but I believe they have a Class Library concept which allows classes to be encapsulated and shared across programs. I think this is what I am looking for in Delphi.

In Delphi I have made some DLLs, but I do not know if they can be used effectively as a class library. It seems packages are the way to go, and I should make my own package in the spirit of the RTL package. I don't know what sort of "gotchas" I'll run into, versioning, etc. However, before I go too far down the wrong rabbit hole I thought it best to humbly ask how this is approached by others.

Thanks!

You must

  1. Create a runtime package for your class(es) and
  2. build your program(s) with runtime packages (plural because in that case you must use the runtime packages for the rtl and vcl/fmx that are used by your package.

Embarcadero Dokwiki on runtime packages

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM