 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
Remy Lebeau (TeamB) Guest
|
Posted: Fri Jan 28, 2005 6:28 pm Post subject: Re: Event Fire Problem |
|
|
"Horváth László" <astralogic (AT) vnet (DOT) hu> wrote
| Quote: | Now when the actual event fires in my object
void _fastcall TServer::OnEvent(TObject *Sender)
|
Where exactly is this being called from? And which thread is it in? Is it
in the same thread as the COM object?
| Quote: | Evet firing is autogenerated:
|
Make the following tweaks:
template <class T> HRESULT
TEvents_5200Server<T>::Fire_OnOpen(void)
{
T * pT = (T*)this;
HRESULT hRes; // <-- here
pT->Lock();
IUnknown ** pp = m_vec.begin();
while (pp < m_vec.end())
{
if (*pp != NULL)
{
m_EventIntfObj.Attach(*pp);
hRes = m_EventIntfObj.OnOpen(); // <-- here
m_EventIntfObj.Attach(0);
}
pp++;
}
pT->Unlock();
return hRes; // <-- here
}
| Quote: | I tried to debug this, and it seems like it is OK, it gets to the
Fire_OnOpen, and executes like the Fire_OnOpen was called
from the implementation object itself, but no real event occurs
on the client side.
|
What is the actual return value of m_EventIntfObj.OnOpen() when the event
fails to be triggered? Chances are, it is not S_OK. IT will probably be
more like RPC_E_WRONG_THREAD.
Gambit
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|