Re: g_io_channel_win32_new_fd()
- From: Tor Lillqvist <tml iki fi>
- To: John Emmas <johne53 tiscali co uk>
- Cc: gtk-list gnome org
- Subject: Re: g_io_channel_win32_new_fd()
- Date: Wed, 3 Mar 2010 15:46:28 +0200
> The REAL situation is that g_io_channel_win32_new_fd() works currectly for
> stdin, stdout and stderr.
Don't be so sure... Note that the file descriptors 0, 1 and 2 in one C
runtime (for instance the msvcrt.dll that the prebuilt glib uses) are
*different* than the file descriptors 0, 1 and 2 in another C runtime
(for instance the msvcrtd.dll that you get if you compile with the
"debugging" runtime in MSVC6).
If your code uses some other C runtime than msvcrt.dll, and in your
code you for instance freopen stdout to a file, that won't affect the
stdout of glib, it will still go to whereever it was going when the
program started.
> 1) If I make a Release build using VC++6, I get a valid pointer.
As expected, because then your code uses msvcrt.dll.
> 2) If I make a Debug build using VC++6, I get an invalid (NULL) pointer.
As expected, because then your code uses msvcrtd.dll.
If you want to be able to debug but still use the same C runtime as
glib, you need to tweak the Visual Studio settings to use the normal
runtime library even in the ""Debug" build.
> 3) If I make either build using VC++8, I get an invalid (NULL) pointer.
As expected, because then your code uses msvcr80.dll or msvcr80d.dll.
--tml
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]