[SHCoCreateInstance is available for use in the operating systems specified in the Requirements section. It may be altered or unavailable in subsequent versions. Instead, use CoCreateInstance.]
Creates Component Object Model (COM) objects that are implemented in Shell32.dll.
SHSTDAPI SHCoCreateInstance( PCWSTR pszCLSID, const CLSID *pclsid, IUnknown *pUnkOuter, REFIID riid, void **ppv );
A pointer to a string to convert to a CLSID. If NULL, pclsid is used as the CLSID.
Type: const CLSID*
The CLSID to create.
A pointer to outer IUnknown. Used for aggregation.
A reference to the IID of the interface to retrieve through ppv.
When this function returns successfully, receives the interface pointer requested in riid.
If this function succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.
We recommend that you use the IID_PPV_ARGS macro, defined in Objbase.h, to package the riid and ppv parameters. This macro provides the correct IID based on the interface pointed to by the value in ppv, which eliminates the possibility of a coding error in riid that could lead to unexpected results.
|Minimum supported client||Windows XP [desktop apps only]|
|Minimum supported server||Windows Server 2003 [desktop apps only]|
|Header||shlobj_core.h (include Shlobj.h)|
|DLL||Shell32.dll (version 5.0 or later)|