CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 5 of 5
  1. #1
    Join Date
    May 1999
    Location
    13 N 77 E
    Posts
    183

    ATLadvise succeeding with m_vec empty

    Can ATladvise succeed(HRESULT hr) without adding the IUnknown pointer in the ConnectionPointContainer array m_vec.

    If so how do i go about finding the problem which is preventing any callbacks from occuring ?



  2. #2
    Join Date
    May 1999
    Posts
    48

    Re: ATLadvise succeeding with m_vec empty

    If you call AtlAdvise, you attempt to be notified by advisor, so the advisor must have a collection of all connections (m_vec).
    Sincerely, Mihai



  3. #3
    Join Date
    May 1999
    Location
    13 N 77 E
    Posts
    183

    Re: ATLadvise succeeding with m_vec empty

    Yes I understand the theory. But can the AtlAdvise return a HRESULT which is succeeded but still fail to add the IUnknown of the sink in the source's collection of IUnknown pointers ?


  4. #4
    Join Date
    May 1999
    Posts
    26

    Re: ATLadvise succeeding with m_vec empty

    yes, i experience this b4. but dunno why this happened.

    adachi


  5. #5
    Join Date
    May 1999
    Location
    13 N 77 E
    Posts
    183

    Re: ATLadvise succeeding with m_vec empty

    I solved the problem I had as below

    IOutgoing is the outgoing interface implemented by the client

    The following works


    IUnknown* pUnk=NULL;IOutgoing* pOutgoing=NULL;
    for(int nClient=0;nClient<m_vec.GetSize();nClient++)
    {
    pUnk=m_vec.GetAt(nClient);
    pOutgoing=(IOutgoing*)pUnk;
    pOutgoing->EventSend(Param);
    }





    The following fails


    IUnknown** ppUnk=NULL;IOutgoing* pOutgoing=NULL;
    for(int nClient=0;nClient<m_vec.GetSize();nClient++)
    {
    *ppUnk=m_vec.GetAt(nClient);
    pOutgoing=(IOutgoing*)*ppUnk;
    pOutgoing->EventSend(Param);
    }





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