Serial Framework C++ Edition

◆ QueryInterface()

virtual HRESULT STDMETHODCALLTYPE QueryInterface ( REFIID  riid,
void **  ppvObject 
)
overridevirtual

Queries a COM object for a pointer to one of its interface; identifying the interface by a reference to its interface identifier (IID). If the COM object implements the interface, then it returns a pointer to that interface after calling AddRef on it.

Parameters
riidA reference to the interface identifier (IID) of the interface being queried for.
ppvObjectThe address of a pointer to an interface with the IID specified in the riid parameter. Because you pass the address of an interface pointer, the method can overwrite that address with the pointer to the interface being queried for. Upon successful return, *ppvObject (the dereferenced address) contains a pointer to the requested interface. If the object doesn't support the interface, the method sets *ppvObject (the dereferenced address) to NULL.
Returns
This method returns S_OK if the interface is supported, and E_NOINTERFACE otherwise. If ppvObject (the address) is NULL, then this method returns E_POINTER.