Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
This function creates an instance of a specified class, with the option to specify the instance name.
Syntax
HRESULT WPRCCreateInstanceUnderInstanceName(
_In_opt_ BSTR bstrInstanceName,
_In_ REFCLSID rclsid,
_In_opt_ LPUNKNOWN pUnkOuter,
_In_ DWORD dwClsContext,
_In_ REFIID riid,
_Outptr_ LPVOID *ppv
);
Parameters
bstrInstanceName
(In_opt BSTR): Optional. The name of the instance. If this parameter is NULL, the function creates an unnamed instance.
rclsid
(In REFCLSID): The CLSID associated with the data and code that will be used to create the object.
pUnkOuter
(In_opt LPUNKNOWN): Optional. If NULL, the object is not being created as part of an aggregate. If non###NULL, pointer to the aggregate object's IUnknown interface (the controlling IUnknown).
dwClsContext
(In DWORD): Context in which the code that manages the newly created object will run. The values are taken from the enumeration class CLSCTX
.
riid
(In REFIID): A reference to the identifier of the interface to be used to communicate with the object.
ppv
(Outptr LPVOID): Address of pointer variable that receives the interface pointer requested in riid
. Upon successful return, *ppv contains the requested interface pointer.
Return Value
The function returns an HRESULT code. A successful execution is typically indicated by S_OK. Failure is indicated by any other HRESULT code, which signifies an error occurred during the execution of the function.