ILocalRegistry::GetClassObjectOfClsid Method (Guid, UInt32, IntPtr, Guid, IntPtr)

 

Returns the class object associated with a CLSID.

Namespace:   Microsoft.VisualStudio.Shell.Interop
Assembly:  Microsoft.VisualStudio.Shell.Interop (in Microsoft.VisualStudio.Shell.Interop.dll)

int GetClassObjectOfClsid(
	[InAttribute] Guid% clsid,
	unsigned int dwFlags,
	IntPtr lpReserved,
	[InAttribute] Guid% riid,
	[OutAttribute] IntPtr% ppvClassObject
)

Parameters

clsid
Type: System::Guid

[in] Class identifier (CLSID) of the requested object. This is the CLSID associated with the data and code that is used to create the object.

dwFlags
Type: System::UInt32

[in] Flags controlling the instance creation from the CLSCTX enumeration. Specifies a value of CLSCTX_INPROC_SERVER.

lpReserved
Type: System::IntPtr

[in] Reserved.

riid
Type: System::Guid

[in] Interface to be used to communicate with the object. For example, IID_IClassFactory.

ppvClassObject
Type: System::IntPtr

[in] Address of pointer variable that receives the interface pointer requested in riid. Upon successful return, ppvObj contains the requested interface pointer. Upon failure, ppvObj contains null.

Return Value

Type: System::Int32

If the method succeeds, it returns S_OK. If it fails, it returns an error code.

From objext.idl:

HRESULT ILocalRegistry::GetClassObjectOfClsid(
   [in] REFCLSID clsid,
   [in] DWORD dwFlags,
   [in] LPVOID lpReserved,
   [in] REFIID riid,
   [in] void** ppvClassObject
);

Specify a value of CLSCTX_INPROC_SERVER for the dwFlags parameter to instantiate the object locally. If you do not specify this value, then the object will be instantiated globally using COM's CoCreateInstance function.

Return to top
Show: