Proper method should look like this:
//////////////////////////////////////////////////////////////////////////
// packs RGBA values into a single DWORD number
unsigned long CWmeUtils::MakeRGBA(unsigned char R, unsigned char G, unsigned char B, unsigned char A)
{
return (unsigned long)((((A)&0xff)<<24)|(((B)&0xff)<<16)|(((G)&0xff)<<8)|((R)&0xff));
}