Navigation:  Programming Cookbook > Creating COM Components > Testing & Debugging > Debugging In-Process >

In-process Start Up Sequence

Previous pageReturn to chapter overviewNext page
1.Client calls CoCreateInstance() (or IClassFactory::CreateInstance()) with CLSCTX_INPROC_SERVER context flag.
2.COM looks up component’s CLSID entry in the registry and uses its InProcServer32 sub-key to find the path of the server DLL to load.
3.COM loads the DLL into the client process (CoLoadLibrary())
4.COM locates (GetProcAddress()) and calls the DllGetClassObject() entry point in the DLL, passing it the CLSID of the component requested by the client.
5.IPDolphin.DLL looks up the requested CLSID in the registry and extracts its Image sub-key to use as the path of the image to load.
6.IPDolphin.DLL creates a Dolphin VM and asks it to load the image.
7.IPDolphin.DLL fires up the image and establishes bilateral communication between running image and launcher stub (see IPDolphin>>onStartup).
8.IPDolphin.DLL invokes IPDolphin>>GetClassObject:riid:ppv:, finally forwarding the DllGetClassObject() call from COM.
9.IPDolphin>>GetClassObject:riid:ppv: looks up the requested CLSID, and if a matching class is registered in the image it answers the requested interface (probably IClassFactory) on a new COMClassFactory instance configured to create instances of the registered Smalltalk class.
10.COM (or the client directly) calls IClassFactory>>CreateInstance(), implemented directly in the image (see COMClassFactory>>CreateInstance:riid:ppvObject:), which creates a new instance of the Smalltalk class that implements the COM component, and queries off the desired interface.
11.If no errors have occurred the interface pointer is returned to the client. In order to return the interface COM must “marshal” the interface pointer into the client’s apartment, so failure is still possible, even at this late stage, if marshalling code is not available for the interface.
12.Assuming there were no errors, and the interface could be marshalled, the client should now be in possession of an interface pointer of the type it requested onto an instance of the component it requested. The client can now use this interface pointer to directly invoke the methods of COM object.