How can I see the results of working with a COM component?
I suppose this question is more general than dealing with COM components. I have a .NET client written in C # and a COM component written in pure Win32 API. The client side uses this component to perform some actions. How do you know on the client that this component has done its job?
I think it could be socket / pipe, with a component that writes to it about the results, and the client reading from it shows progress to the user. What's the best way to do this?
a source to share
With COM, you have no control over the data passing through the socket. You have an RPC-like interface i.e. Your client calls a method on the server that returns a result. No concept of streaming results.
To do what you mentioned, you need to develop an interface implemented by the client, for example, when starting a job, the server returns an id and does the work asynchronously. The client can then check the server regularly by specifying the ID as a parameter and asking the server for actual progress.
Another way to do this is to implement a junction point on the server, which is essentially a callback mechanism so that the server can inform the client of its progress. See CodeProject 1 or CodeProject 2 for more information .
a source to share