2
votes

How can I create a COM DLL (class library) in Delphi?

It is for use on very old PCs where .NET is not, and will not be, installed and will replace, and slightly extend, a VB 6 DLL for which I have the source code.

3
I know I keep banging on about this, but if you build it with Delphi then you may find it hard to have it consumed by a 64 bit process. This may not be an issue to you, and would certainly have been true for the VB6 version, but if you are looking to the future then it's worth being aware of. - David Heffernan
+1 Thanks. Not sure if it's a problem or not; I will code it & see. Basically, a web site servers a page with some JS which calls into the COM DLL (great design, huh?) - Mawg says reinstate Monica
JS can call into COM? Ouch! Presumably there are some limitations on the browsers that can be used and it has to be IE. In that case 32 bit is fine since nobody runs 64 bit IE. - David Heffernan
David - 64 bit delphi will hopefully be released in XE2 which is the next release scheduled. - Warren P
+1 (to both of you). Ouch indeed, but I have to live with it; it's live in the field & has been for 8 years or more. And, yes ... however did you know ... it's MSIE only (any version, no matter how old, afaik) - Mawg says reinstate Monica

3 Answers

6
votes

You create a new ActiveX Library. You find it in the ActiveX tab. (File - New - Other - ActiveX - ActiveX Library)

3
votes

Go through this site which is good start point to develop COM in Delphi. It is having tutorials, articles, and code on COM technologies in Delphi. It might be helpful to you