Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which is "better": COM DLL or Standard DLL with a Typelib?

Tags:

dll

com

typelib

I put "better" in quotes because it's a qualitative question. I've been writing COM DLLs for a couple of years now and have only recently come upon, and successfully used, the standard DLL with Typelib concept.

Are there any compelling reasons to use COM DLLs instead of DLL+Typelib? Granted, you can't do DCOM with a DLL+Typelib, but is that the only reason?

EDIT I've written COM DLLs in Visual C/C++ 6, Compaq Visual Fortran, Delphi, Visual BASIC 6, ActiveState Perl and a few others. I've written standard DLLs in Visual C/C++ 6, Delphi, Ada and a few others. I've written typelibs for some of my own standard DLLs and also for third party DLLs. The question was originally written in the context of a Delphi DLL+Typelib reimplementation of a VB6 original.

like image 689
bugmagnet Avatar asked Oct 11 '08 15:10

bugmagnet


1 Answers

TypeLib's are also important if you ever wish to migrate COM components to managed code in the future. Or have managed code interact with the COM components.

With a typelib there are lots of tools which will automagically translate your COM signatures into .Net interfaces and types. This can be done by hand but with a large project it's certainly a huge time saver.

like image 90
JaredPar Avatar answered Sep 29 '22 01:09

JaredPar