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
Solved

Communicate between 2 exe files.

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

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
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.
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

861 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