1. Beware of setFont in win32
- Posted by Agent Spectre <Email at SPECTRESOFTWARE.CO.UK> Mar 31, 2000
- 679 views
------=_NextPart_000_0006_01BF9B31.57159C00 charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I have uncovered a bizarre bug in the win32 library. While programming = my setup package, I needed to create folders. I was doing this = previously with the System ("md ") command but this brings up a dos box = that flicks on the screen for a second, and clearly wasnt good enough. = So I sat down, did a search through the DLLs and finally found the = routine I needed, five minutes later (and some modified code!) I had my = own windows MD wrapper!! (btw, my first attempt at wrapping functions = from a DLL). Some testing later, and I discovered it was fine... it would create = folders on any drive, with any name, even spaces in between. I slotted it into my setup program and it stopped working. Two hours of infuriating testing later, moving the snippet of code = further and further down the program, I discovered that the command = setFont stopped it from working. A line above and it was fine, a line = after and it stopped. I have no idea why this happens. Maybe Dave Cuny will know, but I am = advise you all to use setFont LAST in your programs (just before WinMain = perhaps) until this is cleared up. Pete King, Spectre Software ------=_NextPart_000_0006_01BF9B31.57159C00 charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3D"text/html; charset=3Dwindows-1252" = http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.2722.2800" name=3DGENERATOR></HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT size=3D2>I have uncovered a bizarre bug in the win32 library. = While=20 programming my setup package, I needed to create folders. I was doing = this=20 previously with the System ("md ") command but this brings up a dos box = that=20 flicks on the screen for a second, and clearly wasnt good enough. So I = sat down,=20 did a search through the DLLs and finally found the routine I needed, = five=20 minutes later (and some modified code!) I had my own windows MD = wrapper!! (btw,=20 my first attempt at wrapping functions from a DLL).</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>Some testing later, and I discovered it was fine... = it would=20 create folders on any drive, with any name, even spaces in = between.</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>I slotted it into my setup program and it stopped=20 working.</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>Two hours of infuriating testing later, moving the = snippet of=20 code further and further down the program, I discovered that the command = setFont=20 stopped it from working. A line above and it was fine, a line after and = it=20 stopped.</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>I have no idea why this happens. Maybe Dave Cuny = will know,=20 but I am advise you all to use setFont LAST in your programs (just = before=20 WinMain perhaps) until this is cleared up.</FONT></DIV> <DIV> </DIV> <DIV><FONT size=3D2>Pete King, Spectre = ------=_NextPart_000_0006_01BF9B31.57159C00--
2. Re: Beware of setFont in win32
- Posted by "Lucius L. Hilley III" <lhilley at CDC.NET> Mar 31, 2000
- 656 views
Pete King states: > Two hours of infuriating testing later, moving the snippet of code = > further and further down the program, I discovered that the command = > setFont stopped it from working. A line above and it was fine, a line = > after and it stopped. Now that is what I call debugging. Lucius L. Hilley III lhilley at cdc.net +----------+--------------+--------------+ | Hollow | ICQ: 9638898 | AIM: LLHIII | | Horse +--------------+--------------+ | Software | http://www.cdc.net/~lhilley | +----------+-----------------------------+
3. Re: Beware of setFont in win32
- Posted by "Cuny, David at DSS" <David.Cuny at DSS.CA.GOV> Mar 31, 2000
- 649 views
Pete King wrote: > Two hours of infuriating testing later, moving the > snippet of code further and further down the program, > I discovered that the command setFont stopped it from > working. A line above and it was fine, a line after > and it stopped. Sorry about your frustrating experience. I thought that particular bug had been nailed, but I guess it's not. The obvious question: are you using the most current version of Win32Lib? If not, could you see if the latest version gets rid of the error? Some time ago, system_exec mysteriously began failing in Win32Lib. I finally tracked it down to a bug in setFont, where the font assignment was going to a Null. I suspect what you are encountering is along those lines. If that's not the problem, could you send me a copy of the *buggy* program, along with a note of where it's failing? Thanks! -- David Cuny
4. Re: Beware of setFont in win32
- Posted by Agent Spectre <Email at SPECTRESOFTWARE.CO.UK> Mar 31, 2000
- 638 views
- Last edited Apr 01, 2000
-----Original Message----- From: Cuny, David at DSS <David.Cuny at DSS.CA.GOV> To: EUPHORIA at LISTSERV.MUOHIO.EDU <EUPHORIA at LISTSERV.MUOHIO.EDU> Date: Friday, March 31, 2000 5:47 PM Subject: Re: Beware of setFont in win32 >Sorry about your frustrating experience. I thought that particular bug had >been nailed, but I guess it's not. > >The obvious question: are you using the most current version of Win32Lib? If >not, could you see if the latest version gets rid of the error? Some time >ago, system_exec mysteriously began failing in Win32Lib. I finally tracked >it down to a bug in setFont, where the font assignment was going to a Null. >I suspect what you are encountering is along those lines. > >If that's not the problem, could you send me a copy of the *buggy* program, >along with a note of where it's failing? > >Thanks! > >-- David Cuny > Im using version 0.45r which I think is the latest version.