コード例 #1
0
/*----------------------------------------------------------------------------------------------
	Get a pointer to the desired interface if possible.  IUnknown, IDataObject, and ITsString
	are supported.  Note that the ITsString interface refers to an internal variable, and cannot
	be used to get back to the IDataObject or the original IUnknown.

	This is a standard COM IUnknown method.

	@param riid Reference to the GUID of the desired COM interface.
	@param ppv Address of a pointer for returning the desired COM interface.

	@return SOK, STG_E_INVALIDPOINTER, or E_NOINTERFACE.
----------------------------------------------------------------------------------------------*/
STDMETHODIMP LgTsDataObject::QueryInterface(REFIID riid, void ** ppv)
{
	AssertPtr(ppv);
	if (!ppv)
		return WarnHr(E_POINTER);
	*ppv = NULL;

	if (riid == IID_IUnknown)
		*ppv = static_cast<IUnknown *>(static_cast<ILgTsDataObject *>(this));
	else if (riid == IID_IDataObject)
		*ppv = static_cast<IDataObject *>(this);
	else if (riid == IID_ILgTsDataObject)
		*ppv = static_cast<ILgTsDataObject *>(this);
	else if (riid == IID_ISupportErrorInfo)
	{
		*ppv = NewObj CSupportErrorInfo(static_cast<IDataObject *>(this), IID_IDataObject);
//		*ppv = NewObj CSupportErrorInfo(this, IID_ITsString);
		return S_OK;
	}
	else
		return E_NOINTERFACE;

	reinterpret_cast<IUnknown *>(*ppv)->AddRef();
	return S_OK;
}
コード例 #2
0
/*----------------------------------------------------------------------------------------------
	QueryInterface.
----------------------------------------------------------------------------------------------*/
STDMETHODIMP TsPropsFact::QueryInterface(REFIID iid, void ** ppv)
{
	AssertPtr(ppv);
	if (!ppv)
		return WarnHr(E_POINTER);
	*ppv = NULL;

	if (iid == IID_IUnknown)
		*ppv = static_cast<IUnknown *>(this);
	else if (iid == IID_ITsPropsFactory)
		*ppv = static_cast<ITsPropsFactory *>(this);
	else if (iid == IID_ISupportErrorInfo)
	{
		*ppv = NewObj CSupportErrorInfo(this, IID_ITsPropsFactory);
		return S_OK;
	}
#if WIN32
	else if (iid == IID_IMarshal)
		return m_qunkMarshaler->QueryInterface(iid, ppv);
#endif
	else
		return E_NOINTERFACE;

	reinterpret_cast<IUnknown *>(*ppv)->AddRef();
	return S_OK;
}
コード例 #3
0
/*----------------------------------------------------------------------------------------------
	QueryInterface.
	Returns a pointer to a specified interface on an object to which a client currently holds
	an interface pointer.
	@param riid  Identifier of the requested interface.
	@param ppv  Address of output variable that receives the interface pointer requested in riid.
----------------------------------------------------------------------------------------------*/
STDMETHODIMP AfChangeWatcher::QueryInterface(REFIID riid, void **ppv)
{
	AssertPtr(ppv);
	if (!ppv)
		return WarnHr(E_POINTER);
	*ppv = NULL;

	if (riid == IID_IUnknown)
		*ppv = static_cast<IUnknown *>(this);
	else if (riid == IID_IVwNotifyChange)
		*ppv = static_cast<IVwNotifyChange *>(this);
	else if (riid == IID_ISupportErrorInfo)
	{
		*ppv = NewObj CSupportErrorInfo(this, IID_IVwNotifyChange);
		return NOERROR;
	}
	else
		return E_NOINTERFACE;

	AddRef();
	return NOERROR;
}
コード例 #4
0
/*----------------------------------------------------------------------------------------------
	Get a pointer to the desired interface if possible.  Only IUnknown and IStream are
	supported.
----------------------------------------------------------------------------------------------*/
STDMETHODIMP FileStream::QueryInterface(REFIID riid, void ** ppv)
{
	AssertPtr(ppv);
	if (!ppv)
		return WarnHr(STG_E_INVALIDPOINTER);
	*ppv = NULL;

	if (riid == IID_IUnknown)
		*ppv = static_cast<IUnknown *>(this);
	else if (riid == IID_IStream)
		*ppv = static_cast<IStream *>(this);
	else if (riid == IID_ISupportErrorInfo)
	{
		*ppv = NewObj CSupportErrorInfo(this, IID_IStream);
		return S_OK;
	}
	else
		return E_NOINTERFACE;

	reinterpret_cast<IUnknown *>(*ppv)->AddRef();
	return S_OK;
}
コード例 #5
0
//:>********************************************************************************************
//:>	IUnknown Methods
//:>********************************************************************************************
STDMETHODIMP VwBaseVirtualHandler::QueryInterface(REFIID riid, void **ppv)
{
    AssertPtr(ppv);
    if (!ppv)
        return WarnHr(E_POINTER);
    *ppv = NULL;

    if (riid == IID_IUnknown)
        *ppv = static_cast<IUnknown *>(this);
    else if (riid == IID_IVwVirtualHandler)
        *ppv = static_cast<IVwVirtualHandler *>(this);
    else if (riid == IID_ISupportErrorInfo)
    {
        *ppv = NewObj CSupportErrorInfo(this, IID_IVwVirtualHandler);
        return S_OK;
    }
    else
        return E_NOINTERFACE;

    AddRef();
    return NOERROR;
}
コード例 #6
0
//:>********************************************************************************************
//:>	IUnknown Methods.
//:>********************************************************************************************
// Get a pointer to the interface identified as iid.
STDMETHODIMP LgTextServices::QueryInterface(REFIID riid, void ** ppv)
{
	AssertPtr(ppv);
	if (!ppv)
		return WarnHr(E_POINTER);
	*ppv = NULL;

	if (riid == IID_IUnknown)
		*ppv = static_cast<IUnknown *>(static_cast<ILgTextServices *>(this));
	else if (riid == IID_ILgTextServices)
		*ppv = static_cast<ILgTextServices *>(this);
	else if (riid == IID_ISupportErrorInfo)
	{
		*ppv = NewObj CSupportErrorInfo(this,IID_ILgTextServices);
		return S_OK;
	}
	else
		return E_NOINTERFACE;

	reinterpret_cast<IUnknown *>(*ppv)->AddRef();
	return NOERROR;
}
コード例 #7
0
/*----------------------------------------------------------------------------------------------
	Get a pointer to the desired interface if possible.  Only IUnknown and IEnumFORMATETC are
	supported.

	This is a standard COM IUnknown method.

	@param riid Reference to the GUID of the desired COM interface.
	@param ppv Address of a pointer for returning the desired COM interface.

	@return SOK, STG_E_INVALIDPOINTER, or E_NOINTERFACE.
----------------------------------------------------------------------------------------------*/
STDMETHODIMP LgTsEnumFORMATETC::QueryInterface(REFIID riid, void ** ppv)
{
	AssertPtr(ppv);
	if (!ppv)
		return WarnHr(E_POINTER);
	*ppv = NULL;

	if (riid == IID_IUnknown)
		*ppv = static_cast<IUnknown *>(this);
	else if (riid == IID_IEnumFORMATETC)
		*ppv = static_cast<IEnumFORMATETC *>(this);
	else if (riid == IID_ISupportErrorInfo)
	{
		*ppv = NewObj CSupportErrorInfo(this, IID_IEnumFORMATETC);
		return S_OK;
	}
	else
		return E_NOINTERFACE;

	reinterpret_cast<IUnknown *>(*ppv)->AddRef();
	return S_OK;
}
コード例 #8
0
//:>********************************************************************************************
//:>	   IUnknown Methods
//:>********************************************************************************************
STDMETHODIMP LgIcuConverterEnumerator::QueryInterface(REFIID riid, void **ppv)
{
	AssertPtr(ppv);
	if (!ppv)
		return WarnHr(E_POINTER);
	*ppv = NULL;

	if (riid == IID_IUnknown)
		*ppv = static_cast<IUnknown *>(static_cast<ILgIcuConverterEnumerator *>(this));
	else if (riid == IID_ILgIcuConverterEnumerator)
		*ppv = static_cast<IUnknown *>(static_cast<ILgIcuConverterEnumerator *>(this));
	else if (riid == IID_ISupportErrorInfo)
	{
		*ppv = NewObj CSupportErrorInfo(static_cast<ILgIcuConverterEnumerator *>(this),
			IID_ILgIcuConverterEnumerator);
		return S_OK;
	}
	else
		return E_NOINTERFACE;

	AddRef();
	return NOERROR;
}
コード例 #9
0
/*----------------------------------------------------------------------------------------------
	Get a pointer to the desired interface if possible.  Only IUnknown and IFwCppStylesDlg are
	supported.

	This is a standard COM IUnknown method.

	@param riid Reference to the GUID of the desired COM interface.
	@param ppv Address of a pointer for returning the desired COM interface.

	@return SOK, E_POINTER, or E_NOINTERFACE.
----------------------------------------------------------------------------------------------*/
STDMETHODIMP FwCppStylesDlg::QueryInterface(REFIID iid, void ** ppv)
{
    AssertPtr(ppv);
    if (!ppv)
        return WarnHr(E_POINTER);
    *ppv = NULL;

    if (iid == IID_IUnknown)
        *ppv = static_cast<IUnknown *>(static_cast<IFwCppStylesDlg *>(this));
    else if (iid == IID_IFwCppStylesDlg)
        *ppv = static_cast<IFwCppStylesDlg *>(this);
    else if (iid == IID_ISupportErrorInfo)
    {
        *ppv = NewObj CSupportErrorInfo(this, IID_IFwCppStylesDlg);
        return S_OK;
    }
    else
    {
        return E_NOINTERFACE;
    }
    reinterpret_cast<IUnknown *>(*ppv)->AddRef();

    return S_OK;
}
コード例 #10
0
/*----------------------------------------------------------------------------------------------

----------------------------------------------------------------------------------------------*/
STDMETHODIMP DbColSpec::QueryInterface(REFIID iid, void ** ppv)
{
	AssertPtr(ppv);
	if (!ppv)
		return WarnHr(E_POINTER);
	*ppv = NULL;

	if (iid == IID_IUnknown)
		*ppv = static_cast<IUnknown *>(static_cast<IDbColSpec *>(this));
	else if (iid == IID_IDbColSpec)
		*ppv = static_cast<IDbColSpec *>(this);
	else if (&iid == &CLSID_DbColSpec)
		*ppv = static_cast<IDbColSpec *>(this);
	else if (iid == IID_ISupportErrorInfo)
	{
		*ppv = NewObj CSupportErrorInfo(this, IID_IDbColSpec);
		return S_OK;
	}
	else
		return E_NOINTERFACE;

	reinterpret_cast<IUnknown *>(*ppv)->AddRef();
	return S_OK;
}