2008/7/4 Maarten Lankhorst m.b.lankhorst@gmail.com:
Hi Austin,
The second 'return E_NOINTERFACE' will never be reached.
Cheers, Maarten.
GCC throws a warning if you remove it. Perhaps this is better:
static HRESULT WINAPI ITextHostImpl_QueryInterface(ITextHost *iface, REFIID riid, LPVOID *ppvObject) { ITextHostTestImpl *This = (ITextHostTestImpl *)iface; *ppvObject = NULL;
if (IsEqualIID(riid, &IID_IUnknown) || IsEqualIID(riid, &IID_ITextHost)) { *ppvObject = (LPVOID)This; ITextHost_AddRef((ITextHost *)(*ppvObject)); return S_OK; } else return E_NOINTERFACE; }