Re: Get parent's console?
From: Vincent Fatica (abuse_at_localhost.com)
Date: 01/25/05
- Next message: Joni: "Windows 2000 Device Driver Book?"
- Next in thread: James Brown: "Re: Get parent's console?"
- Reply: James Brown: "Re: Get parent's console?"
- Maybe reply: Jochen Kalmbach: "Re: Get parent's console?"
- Messages sorted by: [ date ] [ thread ]
Date: 25 Jan 2005 16:53:10 -0500
On Tue, 25 Jan 2005 18:05:53 -0000, "James Brown"
<remove_james_dot_brown7_at_virgin_dot_net> wrote:
>I struggled with AttachConsole under XP, the problem seemed to be
>that the C-runtime stdio handles weren't set correctly, so things like
>printf / fgets just didn't work properly.
After AttachConsole(), set up whatever crt std handles and file descriptors
you will use like this (shown for stdout):
/* AttachConsole(...); */
int hCrt;
FILE *hf;
hCrt = _open_osfhandle(
(long) GetStdHandle(STD_OUTPUT_HANDLE),
_O_TEXT
);
hf = _fdopen( hCrt, "w" );
*stdout = *hf;
i = setvbuf( stdout, NULL, _IONBF, 0 );
-- - Vince
- Next message: Joni: "Windows 2000 Device Driver Book?"
- Next in thread: James Brown: "Re: Get parent's console?"
- Reply: James Brown: "Re: Get parent's console?"
- Maybe reply: Jochen Kalmbach: "Re: Get parent's console?"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|