Solved

COLORREF convert to long

Posted on 2003-12-08
2
1,107 Views
Last Modified: 2013-11-20
Hi,
Is there a way to convert COLORREF to long (and vice-versa) ??

thanks,
Igal.
0
Comment
Question by:igalb
2 Comments
 
LVL 3

Accepted Solution

by:
freewell earned 50 total points
ID: 9902277
Use the casting operator,

COLORREF rgb1 = RGB(255,255,255);
long lData1 = (long)rgb1;
COLORREF rgb2 = (COLORREF)lData;

ASSERT(rgb1 == rgb2);
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9902367
COLRREF is a "unsigned long" definition

typedef unsigned long       DWORD;
typedef DWORD   COLORREF;

Rosh :)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
maxBlock challenge 30 111
twoTwo  challenge 35 93
FizzBuzz challenge 9 76
x-bar in Google Sheets 2 25
In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Hi friends,  in this video  I'll show you how new windows 10 user can learn the using of windows 10. Thank you.

910 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

22 Experts available now in Live!

Get 1:1 Help Now