A question about Console window(display or not display)

I've redirected the (stdin stdout stderr) of a console window process
I spawned to a pipe.

And I want to display the redirected console window, the question is:
If I display it(set Create_new_CONSOLE in createprocess and some flags
in startupinfo), I cannot use the redirected way of pipe, which means
if i do not display, i can use the pipe communicating with the child
process.

Does it mean that as long as I disply the console window, windows will
change stdin stdout to "screen&keyboard" instead of my pipe?

0
9/27/2007 11:49:43 AM
vc.mfc 33608 articles. 0 followers. Follow

1 Replies
613 Views

Similar Articles

[PageSpeed] 58

That's right.  If you redirect stdin or stdout then you preempt the console window.  There
is rarely, if ever, a need for a console window if you have intercepted stdin/stdout, so
don't worry about the console window.  If you want to display the output, the best
technique is to simply take in the stream of characters, split it at newlines, and put the
lines in a CListBox control of your choice.  This can be in your app, or you can pop up a
modeless dialog (the simplest technique) to have a "console window".

I use this as an exercise for my students: CreateProcess, grab the data back from the
pipe, display it in a listbox.  I can send you the code for this if you send me a private
email.
				joe

On Thu, 27 Sep 2007 11:49:43 -0000, lostlander <lostlander.tom@gmail.com> wrote:

>I've redirected the (stdin stdout stderr) of a console window process
>I spawned to a pipe.
>
>And I want to display the redirected console window, the question is:
>If I display it(set Create_new_CONSOLE in createprocess and some flags
>in startupinfo), I cannot use the redirected way of pipe, which means
>if i do not display, i can use the pipe communicating with the child
>process.
>
>Does it mean that as long as I disply the console window, windows will
>change stdin stdout to "screen&keyboard" instead of my pipe?
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
0
newcomer (15977)
9/27/2007 4:39:29 PM
Reply:

Similar Artilces:

Custom Formating Letters to Numbers while Displaying Letters
I am trying to accomplish this in terms of letter grades corresponding to number grades. How do I format a cell so that I can enter a letter grade: A, A-, B+, B, etc. and the corresponding number: 4.00, 3.67, 3.33, 3.00, etc. to each letter grade will be the numeric value of the cell (which I can reference in a formula in a different cell), while the letter remains displayed in the cell? As an example: in cell A1, I would type: B+, I would like B+ to remain displayed, but the value of the cell would be 3.33. Therefore, I could multiply cell B1 (which has a value of 3.00) to cell A1 and...

windows xp frontpage error
Just got a call from my child at college, is getting a message saying to "put in windows xp cd with frontpage", it was installed at the factory and the cd says nothing about frontpage, was installed in coputer in2004 windows xp professional, autoupdatw won't do it. any clue to what is going on? Is freezing computer and won't open excell. Hi Diana, Though this is the newsgroup for Microsoft Dynamics GP and not Windows XP or Ofice, I will try to help you out. In future, please post to the appropriate newsgroup. I believe the error message being received is infact askin...

Backup question
I've moved to a new pc and for some reason I thought that when you backed up, a new file was created. Am I right? At the moment, it's just backing up to the backup file. So I've just just my working file and my backup file. Please could you clarify this? Thanks again. In microsoft.public.money, abc wrote: >I've moved to a new pc and for some reason I thought that when you >backed up, a new file was created. Am I right? At the moment, it's >just backing up to the backup file. So I've just just my working file >and my backup file. P...

Question about Xml Schemas "qualified" and "unqualified"
In the textbook, there is a sentence that "Default XML namespaces(xmlns="...") helps a lot, but can also create problems, as a side effect of the rules for automatic qualification. How to understand "automatic qualification" here? Could you please give me an example? Secondly, unless otherwise specified, a schema prescribes that loal elements and attributes must be "unqualified". What does "unqualified" mean? Could you please giv eme an example? Finnaly, could you please tell me what's purpose of using these two things? Thanks a lot! ...

a question and a question
What is the correct name of the type of selection box used in "customizing Word", for example.... you select a word or operation from a list on the left pane and move it over to the right pane. Is there a template to build one of these? thanx You will have to explain more in detail what you are trying to do. -- Stefan Blom Microsoft Word MVP "cliffordjf" <cliffordjf@discussions.microsoft.com> wrote in message news:9856CCA7-8A8E-440C-A0D4-76EE4FA644E2@microsoft.com... > What is the correct name of the type of selection box used in "c...

Having your form display it's own code?
I am currently working on building a programmer resume. The resume is going to include a series of forms that walk the user through the resume, showing off my coding abilities as they go. I was thinking it would be pretty nifty as well to also have perhaps a read only text box at the bottom of each form where they can view the actual code for that form. The problem is I can't really think of how to get started with that, anybody have any ideas? On Dec 12, 6:40=A0am, CSharp-Jay <bluemana...@gmail.com> wrote: > I am currently working on building a programmer resume. =A0T...

IF AND question
Hi there, I need a function that can provide one of three answers: 1 2 1 1... 3 3 4 4... ? ? ? ?... If A1 = 1 and A2=3, answer 106; but if A1=1 and A2 = 4, answer 104; but if A1=2, regardless of A2, answer 95. The next function for column B is the same, except the answer is dependent on the value delivered from the column A function. E.g. A3 + 6 or A3 +4 or A3-5 etc. Any help would be most appreciated. -- ***** Many thanks Gamq Use the below formula for your first query. =IF(A1="","",IF(A1=2,95,IF(AND(A1=1,A2=3),106,IF(AND(A1=1,A2=4),104)))) ...

IE8 privacy question
I am running XP-Pro SP3 and considering upgrading from IE7 to IE8. I have read all the feature and benefit articles from MS, but have one question that remains unanswered. In IE8 there is mention of being able to restore previously viewed websites or something to that effect. I think this is on a drop down menu somewhere. 1) Does In-private viewing prevent this? 2) Does manually deleting your complete browsing history clear this? 3) Is there a registry entry that can prevent this action? 4) Is there a group policy change that can prevent this action? In essence for privacy pur...

Question about Paste Special
Hi, I have a problem sometimes with the paste special options when goin from one excel workbook to another. For example, sometimes when I cop data from one workbook and then paste special into another, I get th options that include: All, formulas, values, formats, has the option t transpose the data and paste link among other options. And the sometimes I try and paste data to another workbook and I end up th paste special options: Bitmap Image Object, picture, bitmap, and I als lose the ability to paste link. Well you can do it, but it puts it i as an object. What I want is the first past...

Temp Files saved working in a Windows Network
Version: 2008 Operating System: Mac OS X 10.5 (Leopard) Processor: Intel When I save my office documents I worked on there is allways a second file saved which starts like ._ I suppose it is a temp file which is created from the autorecovery process. How can it be solved that these files will be deleted automatically? On 3/24/09 12:16 PM, in article 59b7045c.-1@webcrossing.caR9absDaxw, "alieby@officeformac.com" <alieby@officeformac.com> wrote: > Version: 2008 > Operating System: Mac OS X 10.5 (Leopard) > Processor: Intel > > When I save my office documents I ...

Question
Why did the chicken cross the road? -- Dr. Stephen Hopkins, MD "Dr. Stephen Hopkins, MD" <DrStephenHopkinsMD@discussions.microsoft.com> wrote in message news:B8434E21-DDA3-44D7-B39B-CD5A8C33A7BD@microsoft.com... > Why did the chicken cross the road? > -- > Dr. Stephen Hopkins, MD To collect her email, why else? Dr? You should be ashamed to put such a title on an idiotic off topic post !! -- Regards Steve. MS-MVP. MAIL. [DTS] UK. http://www.getsafeonline.org/ mac;1266180 Wrote: > "Dr. Stephen Hopkins, MD" <DrSte...

Windows XP Pro
Hi, I recently replaced my Outlook.pst file with a backed up one and by doing so, I now have 3 entries called "Personal Folders", instead of 1, that contain *exactly* the same thing. Needless to say it's completely useless and that I would very much like to get rid of the extra entries. This said, when right clicking on the additional 2 entries, I am not allowed to close them... Would have I missed something obvious? Sure, it's not a critical problem, but I just find it irritating, not to mention completely illogical to have 3 identical entries... Cheers, Alan. You&#...

Microsoft Query question
I am trying to use Microsoft Query to get data from my SQL 2000 databases. The problem is that I have a few columns with names that conflict with keywords (like Identity). (Yes. I kow that keywords should be avoided but it is done and cannot be changed.) This is causing a keyword syntax error within the Query application. Oddly enough, even if I do not select the column the error still appears. And when you look at all the columns available, the keyword named column shows up in boldface. When I am doing queries in other programs I put square ("[ ]") brackets around column and table...

OWA Question #16
Hello All: Quick Question regarding OWA. We are about to finalize migration from 5.5 to 2003. We have an existing web presence already in DNS a www.mydomain.com. and running on existing web servers. With 5.5 natrually, to access OWA, it was www.mydomain.com/exchange. This will not be possible now since OWA runs off of the Exchange server instead of relying on our web server under 5.5. What's the easiest way to overcome this. Thanks If you can afford the extra license, you'll probably want to run a front-end server so no one is connecting directly to the Exchange database s...

VBA//Oracle Interfacing Question
All, I have been able to correct to my database but I have one question question: Within objSession I want to list all available tables and all available views. How exactly is this done? thank you. Set objSession = CreateObject("OracleInProcServer.XOraSession") Set objDatabase = objSession.OpenDatabase("", "User/Pass", 0) On Nov 16, 12:05=A0pm, jason <jason.mell...@gmail.com> wrote: > All, > > I have been able to correct to my database but I have one question > question: > > Within objSession I want to list all avail...

Text Box Question
Greetings, I have been using Visio for years, however, something has happened and I can't figure out how to undo it. Basically up until today when I added a text box and entered text, the text went horizontal as it was typed. Today when I add a text box and enter text, the text goes vertical. How do I get back to the old behavior? TIA using text container shape adjusting tool (text block tool), make the text container shape wider horizontally. Have you used Asian text font recently?...check help for "vertical text" "Ray Batig" wrote: > Greetings, > &g...

401K questions
I just started a 401K at work and I'm wondering how to deal with it in Money. I've got my paycheck split into different categories currently and now I have to put the 401K amount into a category as well. I didn't see one specifically for this. What do other people use? Should I start using the 401K Manager? I haven't gone through it yet I'm just wondering if it works well and how much benefit I'll get from it. Thanks in advance! Mike You will want to create an investment account for the 401(k) and TRANSFER your contributions from your checking account to the...

If / Then Question
How would I do this: IF A1="N" then I need A2 and A3 to="N/A -- pkniven ----------------------------------------------------------------------- pknivens's Profile: http://www.excelforum.com/member.php?action=getinfo&userid=2767 View this thread: http://www.excelforum.com/showthread.php?threadid=47531 pknivens Wrote: > How would I do this: > > IF A1="N" then I need A2 and A3 to="N/A" Hi pknivens In A2 and A3 use this formula > =IF(A1="N","N/A",""), this will return blank if A1 is not N, if you want it...

Grabbing desktop image under a window
Hi, I would like to do some processing on a rectangular area of an image. I would like to use a window in a way similar to a magnifier glass, e.g. I would like to move the window onto the desktop, and process the desktop image under the window's client area. Could you please suggest me some ideas to implement this? A trivial approach - but I think ugly and inefficient - I thought would be: 1. Get window client area rect 2. Hide the window 3. Grab desktop sub-image corresponding to client area rect of point 1 4. Show the window 5. Show the processed image Thanks for your suggestions, ...

How to keep display format when exporting XML?
First thank you for taking the time to read about my problem. My problem is this. When exporting my xml data, the time/date values loose their display format. A time of 01:30 am, for example, becomes something like 0.001353 when exported.. What do I need to do to keep the same format as is displayed in Excel? It would sure be great if you could help. Kind regards ...

ROWCOUNT question
Hi All, The below is a UDF that returns the ROWCOUNT for a table. I need to know that value for WHILE loop. How do I take the Returned value from the UDF and load it intio a variable in the SP where it was called from? Or maybe there is another way. ALTER FUNCTION [dbo].[RecCount] ( @TableName CHAR(15) ) RETURNS TABLE AS RETURN ( SELECT Rows FROM sysindexes WHERE id = OBJECT_ID(@TableName) AND indid < 2 ) Thanks, Eric Eric S (xxx_noSpam@Hotmail.com) writes: > The below is a UDF that returns the ROWCOUNT for a table. I need to know > that va...

Shortcuts for most software programs point to Windows Media Player
Many of the shortcuts that I have throughout my system (Windows Vista on a Dell Studio 1537) have suddenly started to point to Windows Media Player. If I try to open software programs through a shortcut, most open Windows Media Player. Has anyone else had this problem? It started this morning. I'm having to go into the program folder and open individual programs directly at the application. Do a thorough check for malware, following all of the steps at one of these Web pages. Help with malware: All MS-MVP Sites. Consider this: Whenever a new error condition appears on your ...

Exmerge Question #7
When I run Exmerge on a mailbox on my 2003 server to export to a PST, it will delete all emails after the copy. I thought EXmerge would "copy" not delete. is this the default? If so how can I just have it do a copy out to the PST and leave the mailbox alone. thanks Rick in "options", make sure "archive data to target store" is not selected on the "Import procedure" tab... -- Susan Conkey [MVP] "Rick" <drummer10980@gmail.com> wrote in message news:1165509540.777142.38260@16g2000cwy.googlegroups.com... > When I run Exmerge on ...

question about "delete"
I have a pointer: MyWindowClass *p = NULL; p = new MyClass(...); .... delete p; After delete p, does p equal NULL(it is in C++ standard?)? How to decide if p has been deleted? The reason I asked this question is that in my project, there are many code/files use the pointer which I need to determine is it is deleted? Can I use: if(p != NULL) delete p; I guess somewhere p has been deleted, but p still not NULL(possible?), the above code might cause problem. Hi Kathy, I typically just set p to NULL when I delete it: delete p; p = NULL; Then you can check it in other places and ...

Writing Text on a Layered Window
I'm attempting to write a program that uses layered windows and i'd like to write text on the window and be able to replace the text at a later time but when I try to just write new text it overlaps the old text and, as you can imagine, looks pretty damn bad. I used a standard CDC (device context) to write the text which works on a window that doesn't use the layered attribute. Is there a better method to drawing the text /or/ is there a way to force an erase/redraw of the base picture of the layered window? You should do this sort of thing in an OnDraw routine (if it's a v...