CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2000
    Location
    Seattle
    Posts
    123

    Infinite loop from MSDN

    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.


  2. #2
    Join Date
    Jul 2000
    Location
    Seattle
    Posts
    123

    Re: Infinite loop from MSDN

    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.


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured