Hello,
could someone verify this is bug :
#define
GetGValue(rgb) (LOBYTE(((WORD)(rgb)) >> 8))Atleast for me it throws runtime-check-error when used.
"""
Run-Time Check Failure #1 - A cast to a smaller data type has caused a loss of data. If this was intentional, you should mask the source of the cast with the appropriate bitmask. For example:
char c = (i & 0xFF);
Changing the code in this way will not affect the quality of the resulting optimized code.
"""
Change to
#define
C_GetGValue(rgb) (LOBYTE(((WORD)(rgb&0xFFFF)) >> 8))helps, so it seems like a small bug in headers to me. I wouldn't like to spam the Microsoft Connect with this though...
Regards,
Martin

bug in wingdi.h ?
CBHCMC
My Name is Adam
Chewy!
Of course, I'm using unmanaged code. No MFC. No ATL.
Or to be exact - I link MFC as static lib, but do not use anything from it (except debug support)
VS2005 Professional.
Vasura
Lorry Craig
Steve Russell
I dont think either :-) So go to vote!
btw: I think MVP should have atleast 5 votes! After all, you had a value, don't you :-)
SWGuy
Lukke
There was already 2 submissions on MS Connect on those:
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx FeedbackID=100961
http://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx FeedbackID=100797
I voted and validated the former.
Thanks for validation!
Regards,
Martin Aliger
Peter K
#include <windows.h>
#undef GetGValue
#define GetGValue(rgb) ((BYTE)(((rgb)&0xFF00)>>8))
jamesIEDOTNET