Re: g_io_channel_win32_new_fd()



Many thanks for the quick response Tor.

GIOChannel* pChan = g_io_channel_win32_new_fd (hPipes[READ]);
// The above call always returns a NULL pointer

No it does not, for me. Not when compiled with MinGW, not when
compiled with MSVC6.

You did use -MD (use msvcrt.dll) I hope? If you don't use the same C
library as GLib uses, the file descriptor passed in your
g_io_channel_win32_new_fd() call is meaningless

I'm using the /MD option which I guess is what you meant?  You're right with
your analysis though.  If I add a getch() call so that the console doesn't
immediately close, I see a glib warning that says
"g_io_channel_win32_new_fd: 3 isn't an open file descriptor in the C library
Glib uses."

Looking through my system I see that I have 7 versions of msvcrt.dll / lib
dating from 11 May 1998 up to 14 Apr 2008.  I also have 5 versions of
msvcrtd.dll / lib, dating from 22 Jan 1997 up to 1 Dec 2006.  I haven't
tried the Release versions yet but I tried all the different Debug versions
one-by-one, but still got the same error message.

If it's not too much trouble Tor, could you let me know the dates for the
versions that you're using and I'll see if I can find a match somewhere?
Thanks.

John



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]