Megosztás a következőn keresztül:


WPRCCreateInstance

Description

This function creates an instance of a specified class.

Syntax

HRESULT WPRCCreateInstance(
    _In_ REFCLSID rclsid,
    _In_opt_ LPUNKNOWN pUnkOuter,
    _In_ DWORD dwClsContext,
    _In_ REFIID riid,
    _Outptr_ LPVOID *ppv
);

Parameters

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.

REFIID 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.

Remarks

Functions