• Welcome to Theos PowerBasic Museum 2017.

Standard DLL <> COM Server DLL - what is the advantage?

Started by Theo Gottwald, June 12, 2010, 09:10:33 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Theo Gottwald

I have just taken a look on this nicely made Project from Jose.
And asked myself, what now the advantage is, from using it a s a COM Object, as a normal programmer.

http://www.jose.it-berater.org/smfforum/index.php?topic=2695.0

One thing i think about is, that a COM Object can be used by everybody.
But if its not for everybody, what is the advanteg of making it a COM Object/Server  instead of just making it a Standard DLL?

Mike Stefanik

One benefit is that a COM object typically is designed to provide a higher-level interface than what most APIs provide. For example, a lot of behavior can be implemented as simple property get/sets that would require various API calls and more coding on the part of the programmer (the benefits of encapsulation). Another is that some languages simply don't have the ability to call functions in an arbitrary DLL and only know how to reference COM objects; an example there would be VBScript or JScript. And, of course, in languages like classic VB (and even VB.NET) using COM objects are more "natural" and less cumbersome than working with an SDK-style API.

On a side-note, one of the really nice features of the new C# in VS2010 is the support for dynamic types which makes it significantly less annoying to work with COM objects. It really brings C# up to par with VB.NET in that area, and they've completely eliminated the need for PIAs (primary interop assemblies) when using COM.
Mike Stefanik
sockettools.com