Re: Back to Bitmaps
- Posted by Jason Gade <jaygade at yahoo.com> Mar 26, 2006
- 445 views
don cole wrote: > > WS_EX_CLIENTEDGE, --style Ex > OR({WS_OVERLAPPED,WS_SYSMENU}), --style > > WS_SYSMENU=#80000 > WS_OVERLAPPED=#0 > > Since #80000 ORed with #0 = #80000 > > Why not just put > WS_EX_CLIENTEDGE, --style Ex > WS_SYSMENU, --style > > Why is the OR needed at all? > > > Don Cole The names are added for clarity. The programmer doesn't necessarily know that WS_OVERLAPPED = 0. Plus when reading the source code someone can see all of the options that the original programmer is intending, whether they are included in some other option or not. If you know what you are doing, you could just put in the hex value you want to use. But you use the names so someone else reading your program can figure out what you are doing. -- "Any programming problem can be solved by adding a level of indirection." --anonymous "Any performance problem can be solved by removing a level of indirection." --M. Haertel "Premature optimization is the root of all evil in programming." --C.A.R. Hoare j.