Creates Component Object Model (COM) objects that share a common context.
HRESULT retVal = object.CreateInstanceWithContext(punkContext, punkOuter, riid, ppvObject);
A pointer to the IUnknown interface that specifies the context, or NULL to create the object in or with the default context.
If the object is created as part of an aggregate, a pointer to the controlling IUnknown interface of the aggregate. Otherwise,, punkOuter must be NULL.
A reference to the identifier of the interface to be used to communicate with the newly created object.
A pointer variable that receives the interface pointer requested by riid.
The context can be used to cache objects that are created by the IClassFactory3 implementation for reuse, or to initialize objects as they are created. Passing NULL in punkContext indicates that the object is created with the default context.
When used with the Windows Internet Explorer scriptlet object library, the object pointer passed in punkContext must support the IServiceProvider interface. The client can specify the scriptlet context to use for creating objects by returning the object in response to the IServiceProvider::QueryService on the site for