Solved

COLORREF convert to long

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

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Macro to save highlighted rows as a separate file 5 43
Named range not carried over 10 63
no14 challenge 14 66
withoutTen challenge 14 119
Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli…
Introduction: The undo support, implementing a stack. Continuing from the eigth article about sudoku.   We need a mechanism to keep track of the digits entered so as to implement an undo mechanism.  This should be a ‘Last In First Out’ collec…
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.
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

816 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

10 Experts available now in Live!

Get 1:1 Help Now