Re: threads/marshalling/callbacks
Why, from an event handler of course in the case of STA. For
example start a timer and fire events within your WM_TIMER
handler. You'll need a [hidden] window for this.
--
=====================================
Alexander Nickolov
Microsoft MVP [VC], MCSD
email: agnickolov@mvps.org
MVP VC FAQ: http://vcfaq.mvps.org
=====================================
"Jason S" <jmsachs@gmail.com> wrote in message
news:1178213438.544732.148540@c35g2000hsg.googlegroups.com...
On May 3, 12:31 pm, "Igor Tandetnik" <itandet...@mvps.org> wrote:
Well, you more or less have the answer already. Your server needs two
threads: one to handle the stream of events, and the other to make
outgoing COM calls. The first thread does not need to be COM-aware;
communicate between the threads by some non-COM means (e.g. events or
window messages).
Hmm, something like that I had considered, but what I don't understand
is how a COM server can initiate outgoing COM calls unless those are
directly the result of an incoming COM call.
Could you give me some more information on how to do this?
I have an EXE server with an apartment SA which handles incoming COM
calls, and has a few callback interface pointers p1, p2, p3.
The EXE server also has a worker thread SW which gets the fast events.
SW will set an Event HANDLE when it thinks that's appropriate.
(Exercise for the reader.)
How can I have a thread in apartment SA initiate an outgoing call
triggered on the Event HANDLE becoming set?