Re: [win32]g_iochannel and USB
Michael Torrie wrote: On 02/22/2012 06:35 AM, Manuel Ferrero wrote: I read the thread, now I know I have to link against the right version of msvcrt.dll. But I'm compiling with MinGW and according what Tor Lillqvist said in that thread it should work. I don't specify any path in my IDE, I just choose the MinGW gcc as a compiler, so I assume I'm using the right DLL. How can I be sure? Still, I can't manage to create a giochannel with the handle I get from the USB DLL CP210x_Open function. Perhaps you need to use this tool on your exe to find out just what dlls it is pulling in: http://www.dependencywalker.com/ I have a strong hunch that the dll providing CP210x_Open is compiled against a much newer version of msvcrt than GTK is. Unfortunately that is a problem because I'm not sure that mingw works with newer versions of msvcrt, and you'd have to rebuild GTK probably as well. I have a question: right now I'm trying to use a commercial version of a dll, compiled by someone I can't contact. How do I know against which version of msvcrt.dll it was compiled? Furthermore, let say for example that it's compiled against the version 2.24 (just a casual number, I have no clue on how msvcrt.dll is versioned) Even if I recompile my GLib/GTK+ on my computer, how can I be sure to use the right version of msvcrt.dll? I could have a completely different version of msvcrt.dll on my PC and I'm back to square one... Or do I miss something? -- Regards, Manuel Ferrero RD department Reer SpA Tel. +39 011 2482215 Fax. +39 011 859867 L'utilizzo non autorizzato del presente messaggio e' vietato e potrebbe costituire reato. Se il presente messaggio non e' a Lei indirizzato, il suo contenuto non deve essere considerato come trasmesso o autorizzato dalla Reer SpA; in tale caso Le saremmo grati se, via e-mail, ce ne comunicasse l'errata ricezione. The unauthorized use of this e-mail is prohibited and could constitute an offence. If you are not the intended recipient of this message its contents shall be understood as neither given nor endorsed by Reer SpA. Please notify Reer SpA by e-mail immediately in that case. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: [win32]g_iochannel and USB
Michael Torrie wrote: On 02/22/2012 06:35 AM, Manuel Ferrero wrote: I read the thread, now I know I have to link against the right version of msvcrt.dll. But I'm compiling with MinGW and according what Tor Lillqvist said in that thread it should work. I don't specify any path in my IDE, I just choose the MinGW gcc as a compiler, so I assume I'm using the right DLL. How can I be sure? Still, I can't manage to create a giochannel with the handle I get from the USB DLL CP210x_Open function. Perhaps you need to use this tool on your exe to find out just what dlls it is pulling in: http://www.dependencywalker.com/ Thanks, this program is really useful, although quite complex to understand. I have a strong hunch that the dll providing CP210x_Open is compiled against a much newer version of msvcrt than GTK is. Unfortunately that is a problem because I'm not sure that mingw works with newer versions of msvcrt, and you'd have to rebuild GTK probably as well. Using Dependency Walker I saw a lot of occurrence of msvcrt.dll, even two as dependency of LIBGLIB-2.0-0.dll and I can't understand why there are two of them. I'll give a try to recompile GTK on my pc, but I'm sure it will be a blood bath... -- Regards, Manuel Ferrero RD department Reer SpA Tel. +39 011 2482215 Fax. +39 011 859867 L'utilizzo non autorizzato del presente messaggio e' vietato e potrebbe costituire reato. Se il presente messaggio non e' a Lei indirizzato, il suo contenuto non deve essere considerato come trasmesso o autorizzato dalla Reer SpA; in tale caso Le saremmo grati se, via e-mail, ce ne comunicasse l'errata ricezione. The unauthorized use of this e-mail is prohibited and could constitute an offence. If you are not the intended recipient of this message its contents shall be understood as neither given nor endorsed by Reer SpA. Please notify Reer SpA by e-mail immediately in that case. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
Re: [win32]g_iochannel and USB
On 02/22/2012 06:35 AM, Manuel Ferrero wrote: I read the thread, now I know I have to link against the right version of msvcrt.dll. But I'm compiling with MinGW and according what Tor Lillqvist said in that thread it should work. I don't specify any path in my IDE, I just choose the MinGW gcc as a compiler, so I assume I'm using the right DLL. How can I be sure? Still, I can't manage to create a giochannel with the handle I get from the USB DLL CP210x_Open function. Perhaps you need to use this tool on your exe to find out just what dlls it is pulling in: http://www.dependencywalker.com/ I have a strong hunch that the dll providing CP210x_Open is compiled against a much newer version of msvcrt than GTK is. Unfortunately that is a problem because I'm not sure that mingw works with newer versions of msvcrt, and you'd have to rebuild GTK probably as well. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list
[win32]g_iochannel and USB
I'm trying to use a DLL for managing an USB connection. In this DLL there is a function to open the USB channel wioth this prototype: int CP210x_Open(DWORD dwDevice, HANDLE* cyHandle); I thought I could link to that handle an iochannel, but I'm not able to make it work. I wrote and compiled the following code: ---SNIP--- GIOChannel *USB_giochannel; int USB_status; HANDLE USB_handle; DWORD USB_device; USB_device = 1; USB_status = CP210x_Open(USB_device, USB_handle); USB_giochannel = g_io_channel_win32_new_fd((int)USB_handle); --PINS--- but when I run it I get the message: GLib-WARNING **: g_io_channel_win32_new_fd: 1740 isn't an open file descriptor in the C library GLib uses. What am I doing wrong? mingw32-gcc version 3.4.5 GTK+ version 2.24.8 -- Regards, Manuel Ferrero RD department Reer SpA Tel. +39 011 2482215 Fax. +39 011 859867 L'utilizzo non autorizzato del presente messaggio e' vietato e potrebbe costituire reato. Se il presente messaggio non e' a Lei indirizzato, il suo contenuto non deve essere considerato come trasmesso o autorizzato dalla Reer SpA; in tale caso Le saremmo grati se, via e-mail, ce ne comunicasse l'errata ricezione. The unauthorized use of this e-mail is prohibited and could constitute an offence. If you are not the intended recipient of this message its contents shall be understood as neither given nor endorsed by Reer SpA. Please notify Reer SpA by e-mail immediately in that case. ___ gtk-app-devel-list mailing list gtk-app-devel-list@gnome.org http://mail.gnome.org/mailman/listinfo/gtk-app-devel-list