views:

592

answers:

2

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.

+2  A: 

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.

JaredPar
Typlib's predate .NET by a long time -- they are used in a lot of other environments, for example VB and in some cases even C++/ATL
Rob Walker
A: 

It really depends on the clients of the component I would think.

Raindog