ICreateObject::CreateObject method
Creates a local object of a specified class and returns a pointer to a specified interface on the object.
Syntax
HRESULT CreateObject( [in] REFCLSID clsid, [in] IUnknown *pUnkOuter, [in] REFIID riid, [out] void **ppv );
Parameters
- clsid [in]
-
Type: REFCLSID
A reference to a CLSID.
- pUnkOuter [in]
-
Type: IUnknown*
A pointer to the IUnknown interface that aggregates the object created by this function, or NULL if no aggregation is desired.
- riid [in]
-
Type: REFIID
A reference to the IID of the interface the created object should return.
- ppv [out]
-
Type: void**
When this method returns, contains the address of the pointer to the interface requested in riid.
Return value
Type: HRESULT
If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
Remarks
This method can be used with GetPropertyStoreWithCreateObject.
Requirements
|
Minimum supported client |
Windows Vista [desktop apps only] |
|---|---|
|
Minimum supported server |
Windows Server 2008 [desktop apps only] |
|
Header |
|
|
IDL |
|