?
Solved

Pass Data between separate exe's

Posted on 2001-06-07
13
Medium Priority
?
209 Views
Last Modified: 2013-11-13
I currently am passing data between two exe via temporary files that I create.  I would like to eliminate the need for the temporary files and pass the data in memory.  Is this possible? If so, how would I begin.  A small sample of two exe's sending data back and forth on the same PC would be appreciated.
0
Comment
Question by:dorinda
[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
  • 4
  • 3
  • 2
  • +4
13 Comments
 
LVL 3

Expert Comment

by:wpsjr1
ID: 6166233
There are three methods that come to mind to pass data between two applications.  SendMessage with WM_COPYDATA, which requires subclassing to get notification of the incomming message.  Memory mapped files which allow for sharing of memory between two apps.  And last, an AX EXE server.  The AX EXE can be accomplished with native VB code.  If you've done some subclassing SendMessage is probably the simplest.  Have you ever done any subclassing/api?
0
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 6166266
0
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 6166269
Hi, here is another one from MSDN:

HOWTO: Pass String Data Between Applications Using SendMessage

http://support.microsoft.com/support/kb/articles/Q176/0/58.asp

0
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 1

Expert Comment

by:superchook
ID: 6166409

Or how about plain old DDE, or IP sockets.

Both are widely documented, compatible with other apps, applicable in local and networked environments and free with VB.
0
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 6166434
then you can try Winsock or MSComm Control to handle this.
0
 
LVL 1

Expert Comment

by:superchook
ID: 6166436
Errr,  Winsock is OK, but MSComm ???
0
 
LVL 53

Expert Comment

by:Ryan Chong
ID: 6166455
As my slight comment, MSComm Control can be use to transmit data via its serial post.

From MSDN:
The MSComm control provides serial communications for your application by allowing the transmission and reception of data through a serial port.

I'd create some protocols using MSComm control to receive and transfer data when i was in college. So that's my opinion about using MSComm but it could be a bad solution..
0
 
LVL 1

Expert Comment

by:superchook
ID: 6166496

OK, I was lead astray - by the original request to pass data between apps - as it seems a bit over the top to use 2x serial ports to talk between two apps on the same machine!

Let's fall-back to the other alternatives DDE & Sockets

Tally-Ho !
0
 
LVL 8

Accepted Solution

by:
glass_cookie earned 400 total points
ID: 6166733
Hi!

I've got the code to pass data from 1 app to another from the same PC using winsock but I forgot where I found it.  Email me at diamond_chip@hotmail.com and I'll pass you the code.

That's it!

glass cookie : )
0
 

Expert Comment

by:ingem
ID: 6167265
If one of your exes is ActiveX exe (server) and another is standard exe(client) you can pass your data from client to server and backwards as parameters in methods and properties. It works well with simple data types and arrays of fixed and varying length.
Here is an example:
-------------------
Server exe has a class named C1
which has method getArray which returns data from server
as an array of varying length:

Public Sub getArray(A() as long,  UboundA as long)
'UboundA  - Upper index of array A
UboundA =10
redeem A(UboundA )

for i=1 to UboundA
'  .... Initializing of array A
next i
end sub
------------------
Client then makes call:
dim P() as long
dim n as long

C1.getArray(p(),n)

and then it gets data in P
To send data from client is even more simple.
 
0
 
LVL 14

Expert Comment

by:wsh2
ID: 6167863
<ping>
0
 

Author Comment

by:dorinda
ID: 6168990
I like the winsock sample from glass_cookie.
0
 
LVL 14

Expert Comment

by:wsh2
ID: 6171441
DORINDA or GLASS_COOKIE

Please Copy / Paste the code if you will.. <smile>>
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Having just graduated from college and entered the workforce, I don’t find myself always using the tools and programs I grew accustomed to over the past four years. However, there is one program I continually find myself reverting back to…R.   So …
This article describes how to use a set of graphical playing cards to create a Draw Poker game in Excel or VB6.
The goal of the video will be to teach the user the concept of local variables and scope. An example of a locally defined variable will be given as well as an explanation of what scope is in C++. The local variable and concept of scope will be relat…
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

777 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