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 bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Applications Talking To Each Other?

Status
Not open for further replies.

mas0

Programmer
Jan 16, 2006
2
CA
I came across a situation where I have to make 2 applications communicate;

APP 1: Checks for a specific condition; and has to send a message to APP 2 that the event occurred; APP 2 responds by sending back a value after executing certain functions. The 2 applications are sitting on the same computer; but are coded in 2 different languages. VB and Delphi.

I could use winsock to send and receive data (As in APP1 is my client APP2 is my server, client connects to server, sends data through sockets) but... I would rather avoid that... as much as possible.

Both applications are gui applications, and its not as simple as emulating a button press or filling a textbox with my info and are both running at the same time. So i cannot just Shellexec the APP2 with a command line param.

What technology should I be using?
 
try windows messaging.

use functions like PostMessage or SendMessage.

-----------------------------------------------------
What You See Is What You Get
Never underestimate tha powah of tha google!
 
Depends on what you want to do. If its control then you should look at COM and OLE automation. Quote from Delphi help.

COM is the Component Object Model, a Windows-based distributed object architecture designed to provide object interoperability using predefined routines called interfaces. COM applications use objects that are implemented by a different process or, if you use DCOM, on a separate machine. You can also use COM+, ActiveX and Active Server Pages.

COM is a language-independent software component model that enables interaction between software components and applications running on a Windows platform. The key aspect of COM is that it enables communication between components, between applications, and between clients and servers through clearly defined interfaces. Interfaces provide a way for clients to ask a COM component which features it supports at runtime. To provide additional features for your component, you simply add an additional interface for those features.

I think that .net allows this sort of linking but I have no experience of this.

If you simply wanted to transfer data, then reading and writing files with periodic checking for changes may be all that is required.


Steve [The sane]: Delphi a feersum engin indeed.
 
PostMessage and SendMessage wouldnt work for me; I quickly looked at some examples and the only data I can actually send are either KEYBOARD or MOUSE events; sending custom data does not work .
he things to be aware of if you use this approach:

1. It can only be used if you are sending messages within the same process - because memory in the sending process cannot be accessed by other processes.


What I actually need to accomplish is executing a remote procedure while passing a few parametres (strings and integer).

i tried to look for examples using COM, however google seems to not want to find anything useful
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top