Re: anonymous pipes
- From: "Luke Alcatel" <nobody@xxxxxxxxxx>
- Date: Tue, 16 May 2006 12:08:13 -0400
Harshal,
Actually this is not an MFC question - if would fit better in
win32.programmer.kernel. I understand how one could have problems trying to
set up two-way parent-child messaging through pipes in win32 - it is
breathtakingly complex compared to the Unix model. One option is to stick
as close as possible to the Unix model as described in:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnucmg/html
/UCMGch09.asp
The conventional win32 method is described in:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dllproc/bas
e/creating_a_child_process_with_redirected_input_and_output.asp
Luke
<harshalshete@xxxxxxxxx> wrote in message
news:1147786111.177627.75490@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
hi group,
i am very new to mfc. and trying to communicate via ipc with the child
process.
but some things i didnot understand after reading the documents.
1) redirecting input and output of the child process i have to use two
pipes
--because it anonymous pipe is only one directional so that for data
to child process one pipe
--and for data from child process another pipe.(understood)
2)the child process inherits the handles so before creating child
process make duplicate copies of that hadle.(i didn't got this
point.)from what i read they say that child should not inherit that
handle.
3)
and actually i am to send the data to child and then able to get his
reply depending on that data for only one time.
if i want to do this untill some event then how i can do this?
means if
parent say's "hello child" then child should respond "hello
parent"
then if parent say's "help" then child "result"
like this untill parent says stop then child will get killed.
so for doing this do i need to handle synchronization?
4)and after every writefile do i need to make a call to CloseHandle();
and if i closed the handle then how i will communicate with child next
time
5) general architecture i want to develope
parent
child
p1
------------------------------------------------------->
p2
<----------------------------------------------------------
architecture
parent
child
step in
--------------------------------------------------------->
respective result
<---------------------------------------------------------
step out
----------------------------------------------------------->
respective result
<---------------------------------------------------------
stop
---------------------------------------------------------------->
will end
(main thing i want to do is that parent should be able to send request
multiple times and then child should respond multiple times)
how to do it?can i do it without threading?
please suggest a good method because i am doing IPC for first time.
Regards &Thanks
Harshal shete
.
- References:
- anonymous pipes
- From: harshalshete@xxxxxxxxx
- anonymous pipes
- Prev by Date: Re: Problem in resizing controls in a Form View -Find the error out
- Next by Date: Re: Problem in resizing controls in a Form View -Find the error out
- Previous by thread: anonymous pipes
- Next by thread: Re: anonymous pipes
- Index(es):
Relevant Pages
|