Solved

Communicate between 2 exe files.

Posted on 1998-10-22
2
181 Views
Last Modified: 2013-11-20
Is it possible to communicate between 2 exe files. One made in MFC and the other in C++. Suggestions will be appreciated. We want to be able to send different variables between the 2 applications.
0
Comment
Question by:joakimf
2 Comments
 
LVL 3

Accepted Solution

by:
stefanr earned 70 total points
ID: 1323734
Alt. 1) Send a windows WM_COPYDATA message (::SendMessage) to the main window of the other application. That's easiest. You could use FindWindow to get a window handle to the other application. If your applications are not windows based (i.e. console), WM_COPYDATA won't work.

Alt. 2) Use a shared data segment in a DLL that is used by both applications that needs to communicate, and use a named event to trigger when the data is updated, so that the other application gets notified. You also need to protect the shared data with a named mutex.

Alt. 3) Use memory mapped files. Map against the paging file. That is the method used internally by the WM_COPYDATA windows message.

Alt. 4) Use a named pipe to read and write data between the processes (or sockets, netbios, etc.). This would work even if the processes were on different machines.

Alt. 5) Use RPC or COM. This is probably the trickiest method, but the most flexible.

What would you prefer?
0
 
LVL 1

Author Comment

by:joakimf
ID: 1323735
Tank you very much for a great answer...
//joakimf
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Process filename extension 3 172
fizzArray2 challenge 1 72
FizzBuzz challenge 9 77
Excel file not created as expected 7 50
Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …

867 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now