Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Using COM as a bridge between two applications

1 view
Skip to first unread message

shash

unread,
Dec 21, 2009, 2:35:34 AM12/21/09
to
hi,

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.

Igor Tandetnik

unread,
Dec 21, 2009, 8:00:50 AM12/21/09
to
shash wrote:
> 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.

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

shash

unread,
Dec 21, 2009, 11:35:37 PM12/21/09
to

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

Igor Tandetnik

unread,
Dec 22, 2009, 12:49:16 AM12/22/09
to
shash wrote:
> therefore what I need know is that, can I use a socket communication
> between my COM server and background application

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.

0 new messages