Click to See Complete Forum and Search --> : Infinite loop from MSDN


Kostello
August 1st, 2000, 04:35 PM
Well obviously the folks at MSDN know what they are doing, so my only conclusion is that I am screwing something up. Anyway, I'm tring to override IObjectSafety by applying an MSDN article. Here is one of the overriding methods:


STDMETHODIMP CMyCtrl::XObjSafety::QueryInterface(REFIID iid, LPVOID far* ppvObj)
{
METHOD_MANAGE_STATE(CMyCtrl, ObjSafety)
ASSERT_VALID(pThis);

return pThis->m_xObjSafety.QueryInterface ( iid, ppvObj);
}




And that looks like it will cause an inf. loop (based on my understanding of the involved MACROS and pThis), which is precisely what it does. Does anyone know a good way to implement the IUnkown functions, or a better way to override interfaces in an MFC ActiveX control? Thanks in advance for any light you can shed on the matter.

Kostello
August 1st, 2000, 04:42 PM
Ok, I got it to work, by using

pThis->ExternalQueryInterface(&iid,pvvObj);



Apparently this calls the base class...?!?!?? Im still confused, but at least less stuck.