Firing Events from thread fail 
Author Message
 Firing Events from thread fail

I have an ActiveX object written in ATL that is used inside a Visual
Basic project.  The ActiveX object receives a callback in a spawned
thread.  When I Fire an Event from the callback within the spawned
thread I get an unhandled exception on the Invoke call, but if I
PostMessage to a window and then Fire an Event from the UI thread it
works.  Why does firing events from a thread not work?

Sent via Deja.com http://www.*-*-*.com/
Before you buy.



Mon, 21 Apr 2003 00:52:31 GMT  
 Firing Events from thread fail

Check out www.mvps.org.. There is a FAQ in which Alex has written some info
about this exact thing.

--
Girish Bharadwaj

Quote:

> I have an ActiveX object written in ATL that is used inside a Visual
> Basic project.  The ActiveX object receives a callback in a spawned
> thread.  When I Fire an Event from the callback within the spawned
> thread I get an unhandled exception on the Invoke call, but if I
> PostMessage to a window and then Fire an Event from the UI thread it
> works.  Why does firing events from a thread not work?

> Sent via Deja.com http://www.deja.com/
> Before you buy.



Mon, 21 Apr 2003 03:43:59 GMT  
 Firing Events from thread fail
Item 1 in the COM/ATL FAQ. The link in my signature is the general
page with all VC FAQs.

BTW, Girish, may be it would be nice if you add something too :)...
Right now the whole COM FAQ has only 3 questions, hardly a serious
FAQ :(...

--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD

MVP VC FAQ: http://www.mvps.org/vcfaq
=====================================


Quote:
> Check out www.mvps.org.. There is a FAQ in which Alex has written some
info
> about this exact thing.

> --
> Girish Bharadwaj



Quote:
> > I have an ActiveX object written in ATL that is used inside a Visual
> > Basic project.  The ActiveX object receives a callback in a spawned
> > thread.  When I Fire an Event from the callback within the spawned
> > thread I get an unhandled exception on the Invoke call, but if I
> > PostMessage to a window and then Fire an Event from the UI thread it
> > works.  Why does firing events from a thread not work?

> > Sent via Deja.com http://www.deja.com/
> > Before you buy.



Mon, 21 Apr 2003 08:07:39 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Fire Events from ctrl's constructor failed

2. firing events from second thread

3. Firing events from a worker thread

4. How to serialized events fired from a secondary thread

5. Firing events from worker threads

6. Fire Events from Thread Pool

7. help firing event from thread

8. Event firing inside a Thread ??

9. Firing Events from a different thread

10. Creating threads and firing events in COM!

11. fire event in second thread does not work in MinDependency

12. Connection Pionts Event firing in worker thread

 

 
Powered by phpBB® Forum Software