Prev: System("..") without flicker
Next: Compiler error
From: Gamer Z on 8 May 2010 00:56 I'm creating my own sort of command prompt which requires that the programs executed through it are able to communicate with the console, so that these programs can actually have the console display something. The method I'm thinking of requires direct communication between processes, but the only way I can think of is writing to the hard disk, which is inefficient and inadvisable.
From: Jackie on 8 May 2010 02:46 I can think of a few things. Using named pipes, sockets or Windows messages, for example. Actually, please take a look here: http://msdn.microsoft.com/en-us/library/aa365574%28VS.85%29.aspx -- --------------------------------- --- -- - Posted with NewsLeecher v4.0 Beta 17 (Release Candidate 4) Web @ http://www.newsleecher.com/?usenet ------------------- ----- ---- -- -
From: Arny on 8 May 2010 03:46 On 08.05.2010 06:56, Gamer Z wrote: > I'm creating my own sort of command prompt which requires that the > programs executed through it are able to communicate with the console, > so that these programs can actually have the console display > something. The method I'm thinking of requires direct communication > between processes, but the only way I can think of is writing to the > hard disk, which is inefficient and inadvisable. Memorymapped file. The easiest way to do interprocess communcication, and it's safe. Windows uses it itself to be compatible with legacy code, e.g WM_COPYDATA. - RaZ
From: Richard Russell on 8 May 2010 05:09 On May 8, 5:56 am, Gamer Z <gamerz...(a)gmail.com> wrote: > the only way I can think of is writing to the > hard disk, which is inefficient and inadvisable. Sharing an open file between processes (e.g. one with write access and one with read access) is not necessarily "inefficient and inadvisable" because the file will likely be cached. Most of the time you'll be doing transfers to/from RAM rather than accessing the disk itself. However, as Jackie points out there are many alternative and possibly better ways of doing it, and I would reiterate the suggestion to study the relevant Microsoft article: http://msdn.microsoft.com/en-us/library/aa365574.aspx Richard. http://www.rtrussell.co.uk/
From: Alf P. Steinbach on 8 May 2010 06:00
On 08.05.2010 06:56, * Gamer Z: > I'm creating my own sort of command prompt which requires that the > programs executed through it are able to communicate with the console, > so that these programs can actually have the console display > something. The method I'm thinking of requires direct communication > between processes, but the only way I can think of is writing to the > hard disk, which is inefficient and inadvisable. If the plan is to run console programs, just redirect the new process' standard io stream handles. See CreateProcess docs. If the plan is something else, something out of the ordinary so that you cannot use the standard OS-supported solution, then please specify. Cheers & hth., - Alf |