Click to See Complete Forum and Search --> : ATLadvise succeeding with m_vec empty


muscicapa
May 20th, 1999, 10:59 PM
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 ?

mihai
May 21st, 1999, 01:55 AM
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

muscicapa
May 22nd, 1999, 11:55 PM
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 ?

Adachi
June 1st, 1999, 01:52 AM
yes, i experience this b4. but dunno why this happened.

adachi

muscicapa
June 2nd, 1999, 07:29 AM
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);
}