I'm having a excel application and a background process written in c+
+ , in same local machine. I'm trying to create a COM object to handle
the communication between these two applications.
I already created a COM which provides some interfaces to access COM
functionality. These are used by my excel application.
But still I could not find a way handle the communication between my
COM object and the background cpp application. According my knowledge,
when excel file opened the dll (com) is loaded into its address space,
therefore I need to communicate with this already loaded dll instance.
Can I use MIDL to get this done, or is there any better approach ?
Thank you.
If you want to use COM for interprocess communication (IPC), then you need to implement a COM object in your background application, thus turning it into a COM server. You could then use it directly from Excel, or have your in-proc COM object act as an intermediary.
Alternatively, there are plenty of other IPC mechanisms you could use to communicate with your app.
--
With best wishes,
Igor Tandetnik
With sufficient thrust, pigs fly just fine. However, this is not necessarily a good idea. It is hard to be sure where they are going to land, and it could be dangerous sitting under them as they fly overhead. -- RFC 1925
thanks for the reply,
The problem I'm having is that I could not extend the background
process and the only thing I can do is to Listen the messages
published by this background process. (simply there should be clear
separation between my COM server and other background process)
therefore what I need know is that, can I use a socket communication
between my COM server and background application, or is there any
other standard windows messaging mechanism I could use here ?
thank you
Yes. This would be one possible IPC mechanism.
> or is there any
> other standard windows messaging mechanism I could use here ?
There are lots. But didn't you say you can't modify that "background application"? If you can't modify it, and it only knows how to talk over sockets, then sockets it is, I guess.