示例#1
0
//:>********************************************************************************************
//:>	   IUnknown Methods
//:>********************************************************************************************
STDMETHODIMP LgInputMethodEditor::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<ILgInputMethodEditor *>(this));
	else if (riid == IID_ISimpleInit)
		*ppv = static_cast<ISimpleInit *>(this);
	else if (riid == IID_ILgInputMethodEditor)
		*ppv = static_cast<ILgInputMethodEditor *>(this);
	else if (riid == IID_ISupportErrorInfo)
	{
		*ppv = NewObj CSupportErrorInfo2(static_cast<ILgInputMethodEditor *>(this),
			IID_ISimpleInit, IID_ILgInputMethodEditor);
		return S_OK;
	}
	else
		return E_NOINTERFACE;

	AddRef();
	return NOERROR;
}
示例#2
0
//:>********************************************************************************************
//:>	   IUnknown Methods
//:>********************************************************************************************
STDMETHODIMP FwGrEngine::QueryInterface(REFIID riid, void **ppv)
{
	if (!ppv)
		return E_POINTER;
	AssertPtr(ppv);
	*ppv = NULL;
	if (riid == IID_IUnknown)
		*ppv = static_cast<IUnknown *>(static_cast<IRenderEngine *>(this));

	else if (riid == IID_IRenderEngine)
		*ppv = static_cast<IRenderEngine *>(this);
	else if (riid == IID_IRenderingFeatures)
		*ppv = static_cast<IRenderingFeatures *>(this);
	//else if (riid == IID_IJustifyingRenderer)
	//	*ppv = static_cast<IJustifyingRenderer *>(this);
	else if (riid == IID_ITraceControl)
		*ppv = static_cast<ITraceControl *>(this);
	else if (&riid == &CLSID_FwGrEngine)
		*ppv = static_cast<FwGrEngine *>(this);

	//else if (riid == CLSID_FwGrEngine) // TODO: ask JOHN about this
	//{
	//	Assert(false);
	//	*ppv = static_cast<FwGrEngine *>(this);
	//}

	else if (riid == IID_ISupportErrorInfo)
	{
		// for error reporting:
		*ppv = NewObj CSupportErrorInfo2(static_cast<IRenderEngine *>(this),
			IID_ISimpleInit, IID_IRenderEngine);
		return NOERROR;
	}

#ifdef OLD_TEST_STUFF
	else if (riid == IID_IGrEngineDebug)		// trick for test code instrumentation
	{
		GrEngineDebug * pgrengd = NewObj GrEngineDebug(this);
		HRESULT hr = pgrengd->QueryInterface(riid, ppv);
		pgrengd->Release();
		return hr;
	}
#endif // OLD_TEST_STUFF

	else
		return E_NOINTERFACE;
	AddRef();
	return NOERROR;
}
示例#3
0
//:>********************************************************************************************
//:>	   IUnknown Methods
//:>********************************************************************************************
STDMETHODIMP RomRenderEngine::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<IRenderEngine *>(this));
	else if (riid == IID_IRenderEngine)
		*ppv = static_cast<IRenderEngine *>(this);
	else if (riid == IID_ISupportErrorInfo)
	{
		*ppv = NewObj CSupportErrorInfo2(static_cast<IRenderEngine *>(this),
			IID_ISimpleInit, IID_IRenderEngine);
		return S_OK;
	}
	else
		return E_NOINTERFACE;

	AddRef();
	return NOERROR;
}