Solved

COLORREF convert to long

Posted on 2003-12-08
2
1,113 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

Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Perl Awk Need Help 3 128
string initialization in java 11 115
centeredAverage challenge 8 179
Problem to App source 6 71
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.

840 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