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 ?
Printable View
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 ?
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
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 ?
yes, i experience this b4. but dunno why this happened.
adachi
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);
}