Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How 2 use COM to communicate between apps ?

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi, I have 2 applications (.exe) that need to communicate.

I know how to have a bidirectional communication between an application and a COM object using a callback object (sink).

app <----> COM

So I devise the following:

app1 <----> COM <----> app2

Is that possible ?
I´m getting trouble to put that to work.
What I need to know to make this happens ?

Thanks.
 
Are your 2 applications hosted on the same server ??
Depends on where your applications are hosted,you need to register on defferent or one server.
COM by nature is distributed and this secret lies in its success.What I mean is for that only we use COM otherwise why to use ??

I think this article can help you out ..??


Rushi Shroff
 

>Are your 2 applications hosted on the same server ??

No.

App1 connect to my COM object and pass an interface pointer to a callback object created inside app1, so my COM object can “talk” with my app1.

This pointer is stored in the global scope of my COM executable housing, so other instances of the COM object can acess app1 too.

I got no trouble with this. Ex: If App1 after that, creates 10 instances of the COM object, they all got acess to my app1 via the global pointer, and everything is fine, they all can “talk” with app1.


The problem occurs when a second App (app2) instantiate an instance of the COM object and this instance try to use the global pointer to acess app1.


_globalPointer->Do(); // don´t work, although the value of this pointer seems valid !



I think it has to do w/ threading/apartment models, or maybe the “global scope” of my COM exe housing isn´t so global when differents apps are involved.


Any suggestion ?


Thanks in advance,
Luis Gustavo Cruz

Inovax Engenharia de Sistemas



PS: Thanks for the article.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top