Solved

Communicate between 2 exe files.

Posted on 1998-10-22
2
180 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

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
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…
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.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

744 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

11 Experts available now in Live!

Get 1:1 Help Now