Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Communicate between 2 exe files.

Posted on 1998-10-22
2
Medium Priority
?
202 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

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

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
Screencast - Getting to Know the Pipeline

610 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