?
Solved

Communicate between 2 exe files.

Posted on 1998-10-22
2
Medium Priority
?
195 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 3

Accepted Solution

by:
stefanr earned 280 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

Get MongoDB database support online, now!

At Percona’s web store you can order your MongoDB database support needs in minutes. No hassles, no fuss, just pick and click. Pay online with a credit card. Handle your MongoDB database support now!

Question has a verified solution.

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

Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
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 …
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.
In this video, Percona Solution Engineer Rick Golba discuss how (and why) you implement high availability in a database environment. To discuss how Percona Consulting can help with your design and architecture needs for your database and infrastr…
Suggested Courses

764 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