Archived

This topic is now archived and is closed to further replies.

RamboBones

Communicating between processes

Recommended Posts

Does anybody know how to get two Win32 processes to be able to communicate through each other. Like send messages and data to each other. I thought about using windows but since one of the processes won''t actually have a window assigned to it I didn''t really want to create a small one and hide it just for that purpose. What I''m looking for is something similar to the two applications reading and writing from the same file to pass information, only a better model of that. I looked at pipes but can''t understand how to use them or even if they do what I want. If anybody knows how to do this then please tell me.

Share this post


Link to post
Share on other sites
Actually, using hidden windows as middlemen might be the most straightforward solution if you''re unwilling to use pipes.

If you''re seeking one-way communication between parent and child applications, you may want to look into anonymous pipes. If you''d like the two applications to send and receive data over a single, two-way connection, consider a named pipe.

Mailslots are most similar to the type of mechanism you described: an application creates a mailslot by reserving a certain amount of space in memory (analogous to a file on the hard disk). Other applications deposit information into the mailslot, and the owner application accesses and acts on the received contents.

________________________________________________
RapscallionGL development continues...
"Optimal decisions, once made, do not need to be changed." - Robert Sedgewick, Algorithms in C

Share this post


Link to post
Share on other sites
okay, a mailslot seems just like what I want. but umm.... how do I use one. Got any links to some tutorials or anything?

Edit: i'll look around on MSDN

Edit2: I've gotten mailslots working, thanks guys

[edited by - RamboBones on January 15, 2004 12:34:12 AM]

[edited by - RamboBones on January 16, 2004 1:27:36 AM]

Share this post


Link to post
Share on other sites