1. Value of CLR_INVALID?
- Posted by "Cuny, David at DSS" <David.Cuny at DSS.CA.GOV> Jan 20, 2000
- 1985 views
Does anyone know what the correct value of CLR_INVALID is supposed to be? EX12 in Win32Lib was reporting an error. The offending line was: if c_func(xSetTextColor, {hdc, window_font[id][FontColor]} ) = CLR_INVALID The SetTextColor routine returns the prior color of the device context, or CLR_INVALID if there was an error. The problem was that CLR_INVALID was defined: CLR_INVALID = #FFFF Which is actually a valid color (BrightYellow). So when the text is drawn in a different color following text in bright yellow causes Win32Lib to report an error. I've taken a look in the files I've got, but I don't see the constant defined anywhere. The closest I can find are: CLR_NONE = #FFFFFFFF CLR_DEFAULT = #FF000000 Any ideas? Thanks! -- David Cuny
2. Re: Value of CLR_INVALID?
- Posted by David Guy <dguy at MINDSPRING.COM> Jan 20, 2000
- 1954 views
On Thu, 20 Jan 2000 15:03:22 -0800, Cuny, David at DSS <David.Cuny at DSS.CA.GOV> wrote: >Does anyone know what the correct value of CLR_INVALID is supposed to be? In the WINGDI.H file its defined as: #define CLR_INVALID 0xFFFFFFFF David Guy
3. Re: Value of CLR_INVALID?
- Posted by Greg Phillips <i.shoot at REDNECKS.COM> Jan 20, 2000
- 1946 views
You were correct.... According to this *huge* list of Windows constants and such, Public Const CLR_INVALID = &HFFFF Of course, that still doesn't solve your problem.... Greg "Cuny, David@DSS" wrote: > Does anyone know what the correct value of CLR_INVALID is supposed to be? > > EX12 in Win32Lib was reporting an error. The offending line was: > > if c_func(xSetTextColor, {hdc, window_font[id][FontColor]} ) = > CLR_INVALID > > The SetTextColor routine returns the prior color of the device context, or > CLR_INVALID if there was an error. The problem was that CLR_INVALID was > defined: > > CLR_INVALID = #FFFF > > Which is actually a valid color (BrightYellow). So when the text is drawn in > a different color following text in bright yellow causes Win32Lib to report > an error. > > I've taken a look in the files I've got, but I don't see the constant > defined anywhere. The closest I can find are: > > CLR_NONE = #FFFFFFFF > CLR_DEFAULT = #FF000000 > > Any ideas? > > Thanks! > > -- David Cuny
4. Re: Value of CLR_INVALID?
- Posted by Greg Phillips <i.shoot at REDNECKS.COM> Jan 20, 2000
- 1961 views
Interesting. In lcc-win32, CLR_INVALID isn't defined, so here's the fix I saw: #define CLR_NONE 0xFFFFFFFF #define CLR_INVALID CLR_NONE Greg
5. Re: Value of CLR_INVALID?
- Posted by Bernie Ryan <bwryan at PCOM.NET> Jan 20, 2000
- 1950 views
- Last edited Jan 21, 2000
David It should be #FFFFFFFF Bernie
6. Re: Value of CLR_INVALID?
- Posted by Pete Eberlein <xseal at HARBORSIDE.COM> Jan 20, 2000
- 1991 views
- Last edited Jan 21, 2000
On Thu, 20 Jan 2000 19:42:58 -0500, Bernie Ryan <bwryan at PCOM.NET> wrote: >David > > It should be #FFFFFFFF > > Bernie or it could be -1. Pete