views:

26

answers:

1

Would it be possible for a COM client to signal a thread in a COM Server?

+3  A: 

To let a COM client signal the server, you'd need some COM interface like this:

interface IClientServerSignalling
{
   void SignalMyServer();
}

The COM Client would QueryInterface on some existing object (or you could implement a specific object just for this purpose) and then call the method, which gets marshalled across to the COM server where it gets executed. The method could then do whatever you need.

If you're trying to get an invocation on a specific worker thread on the COM server, then your SignalMyServer() method could use synchronization mechanisms such as CreateEventEx() and the wait functions to talk across. Arguably, you could do this from COM Client to COM Server without using a COM API but that assumes you know where the COM Server is running and that you have the right security privileges and permissions to do so.

JBRWilkinson