Call this method to create an object of the class associated with a specified Class ID or Program ID.
HRESULT CoCreateInstance( LPCOLESTR szProgID, LPUNKNOWN pUnkOuter = NULL, DWORD dwClsContext = CLSCTX_ALL ) throw( ); HRESULT CoCreateInstance( REFCLSID rclsid, LPUNKNOWN pUnkOuter = NULL, DWORD dwClsContext = CLSCTX_ALL ) throw( );
Pointer to a ProgID, used to recover the CLSID.
If NULL, indicates that the object is not being created as part of an aggregate. If non-NULL, is a pointer to the aggregate object's IUnknown interface (the controlling IUnknown).
Context in which the code that manages the newly created object will run.
CLSID associated with the data and code that will be used to create the object.
In debug builds, an assertion error will occur if CComPtrBase::p is not equal to NULL.