VB COM instantiation/technical details - "behind the scenes" information desired
Posted on 2003-03-09
I have some questions regarding VB COM objects and was wondering if anyone who really understands this could answer the following questions:
1. When I instantiate a COM object (using the new keyword or CreateObject) what really happens? Object is created in memory? Multiple objects are created in memory? For a COM built in VB, does the VB runtime get loaded into memory?
2. If one client instantiates multiple object (more than one OF THE SAME OBJECT or multiple VB based COM objects) does the vb runtimes get loaded into memory multiple times?
eg. Set obj1 = New cObject
Set obj2 = New cObject
Set obj3 = New cObject
In this scenario, what is actually loaded into memory?
3. When a component is hosted in COM+, does the answer to question #2 change? I know that VB is not multi-threaded and cannot have multiple objects loaded on individual threads, but can have multiple instances of an object on a single thread. What really is the difference between multiple instances in a single thread -vs- multiple objects on multiple threads? Just the ability to asynchronously execute methods?
I have been trying to find any documentation that can help me better understand the internals of what is going on but have been unsuccessful in my search. Any help in better understanding the above questions would be most aprpeciated.