BorlandTalk.com Forum Index BorlandTalk.com
Borland discussion newsgroups
 
Archives   FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Named Pipes as Files

 
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API)
View previous topic :: View next topic  
Author Message
Mike King
Guest





PostPosted: Tue Feb 22, 2005 2:43 pm    Post subject: Named Pipes as Files Reply with quote



From time to time, I find that it would be nice to pipe input into a GUI
application like one would do for a console application by using the '|'
character. Is it possible to create a named pipe and pull content from it
as if it were a file?


Back to top
Bob Gonder
Guest





PostPosted: Tue Feb 22, 2005 4:27 pm    Post subject: Re: Named Pipes as Files Reply with quote



Mike King wrote:

Quote:
From time to time, I find that it would be nice to pipe input into a GUI
application like one would do for a console application by using the '|'
character. Is it possible to create a named pipe and pull content from it
as if it were a file?

What is it exactly, that you want to do?
'|' and '<' redirected stdin.
'>' redirected stdout.

Those pipes still work from the commandline.

An application can create pipes, and launch a sub program that will
then think those pipes are stdin and stdout.
See CreateProcess(), and in particular, the STARTUPINFO structure.




Back to top
Mike King
Guest





PostPosted: Tue Feb 22, 2005 4:47 pm    Post subject: Re: Named Pipes as Files Reply with quote



"Bob Gonder" <notbg (AT) notmindspring (DOT) invalid> wrote

Quote:
Mike King wrote:

From time to time, I find that it would be nice to pipe input into a GUI
application like one would do for a console application by using the '|'
character. Is it possible to create a named pipe and pull content from it
as if it were a file?

What is it exactly, that you want to do?
'|' and '<' redirected stdin.
'>' redirected stdout.

Those pipes still work from the commandline.

An application can create pipes, and launch a sub program that will
then think those pipes are stdin and stdout.
See CreateProcess(), and in particular, the STARTUPINFO structure.

I was thinking about a pull-modal where the data is dynamic (probably
endless) so a file would not be the best solution. Just as an example, I
would like Notepad to be able to read from the pipe. So I would click
File -> Open then type in \.pipemynamedpipe and click Open. Notepad then
would show me some data that would be produce by a Windows Service or a
application that is running in the background.



Back to top
Remy Lebeau (TeamB)
Guest





PostPosted: Tue Feb 22, 2005 7:34 pm    Post subject: Re: Named Pipes as Files Reply with quote


"Mike King" <emailMK (AT) excite (DOT) com> wrote


Quote:
From time to time, I find that it would be nice to pipe input into
a GUI application like one would do for a console application by
using the '|' character. Is it possible to create a named pipe and
pull content from it as if it were a file?

Look at GetStdHandle() or GetStartupInfo() to get the process's STDIN pipe,
and then you can use that with ReadFile().


Gambit



Back to top
Display posts from previous:   
Post new topic   Reply to topic    BorlandTalk.com Forum Index -> C++ Builder (Native API) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2006 phpBB Group
SEO toolkit © 2004-2006 webmedic.