What is the advantage of using/making a COM object over using a dll ?
Well, there are three ways to make a COM object. You can leave it inside your program, you can place it a .dll, or you can place it inside another .exe. There are advantages and disadvantages to each way, you pick the one that's most useful to you. Obviously, the first two run in the same process as your main program. Inside another .exe it will run in a seperate thread (and process). The biggest advantage of a COM dll is the simple way it becomes reuseable by most any language that supports COM. For example, this way you can very simply add a lightning fast calculation method to a slow VB normally program.
I admit I am missing an important concept here. >Now imagine that you see >100,000 copies of this program, but you don't want to send out >100,000 upgrades! to update the graphics COM object, all you do >is give the users the new COM object for graphics and the >program will automatically use it. Aren't I sending out 100,000 com dll's ? And how does the program automatically use the new function ? >For example, > this way you can very simply add a lightning fast calculation method to a slow VB normally program. But I can use do that with a dll in VB now. I'm not trying to be a smart a** here, I simply do not yet see the advantage to COM. I have read the MSDN abstracts on COM and it appears to me that COM is MS's way of fixing version problems. So it seems to be an advantage to them. I just don't see the advantage beyond that ..... yet.
As Ernie said: The biggest advantage of a COM dll is the simple way it becomes reuseable by most any language that supports COM. try that with a regular dll. Lots of languages will be uncapable of accessing it.
knowop, if you:
Maintain the same interfaces in the new COM Unregister the old COM file Register the new COM file
...then your programs will automatically use the new code. Look at the XML DOM as an example of this. You can even have multiple versions installed and use specific features of specific version; and a general interface for newest code.
yes COm is pretty much like a .dll ... One more advantage i can think of...is that a COM object can (at least in theory) have a "design time" behviour and actively (hence ActiveX) present itself to the Visual Developement IDE ;)
Thanks for all the replies. With them and some more reading the fog is lifting slowly.