Output one one command prompt

When people create a consol windows project in vc++, it output onely one cmd prompt ? What if I'd like to output 2 or 3 at the same time ? Is that possible ? Thank you
[172 byte] By [grabbler] at [2007-11-19 9:09:41]
# 1 Re: Output one one command prompt
I never seem to get any help here, somebody gives me an explanation ?anyone ??
grabbler at 2007-11-10 3:40:28 >
# 2 Re: Output one one command prompt
Of course it is possible. Just use multiple handles.

ahoodin

void CConsoletestDlg::OnButton1()
{
char cbuffer[36];
DWORD dwout=1;
AllocConsole();
HANDLE handle = GetStdHandle( STD_OUTPUT_HANDLE );
HANDLE handle2 = GetStdHandle(STD_INPUT_HANDLE);
if (WriteConsole(
handle,
"Friend? Y/N\n",
strlen("Friend? Y/N\n"),
NULL,
NULL)
)
{
AfxMessageBox("Write Error");
}

{
if ( !ReadConsole(
handle2,
&cbuffer[0],
2,
&dwout,
NULL ) )
{
AfxMessageBox("Read Error");//use getlasterror
}
else
{
if (WriteConsole(
handle,
(void*)cbuffer[0],
1,
NULL,
NULL)
)
{
AfxMessageBox("Write Error");

}
}
} while (!(cbuffer[0] == 'y' || cbuffer[0] == 'Y'|| cbuffer[0] == 27));
FreeConsole();
}
ahoodin at 2007-11-10 3:41:28 >
# 3 Re: Output one one command prompt
Thanks a lot, but is it possible to use ShellExecute to wake up another cmd ? I have never tried it before...
grabbler at 2007-11-10 3:42:27 >