473,783 Members | 2,350 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

The problem in #define

#define RGB(r,g,b)((COL ORREF)((BYTE)(r )| \

((WORD)((BYTE)( g))<<8))| \

((DWORD)(BYTE)( b))<<16)))

what is the "| \" mean above?

who give me a answer? Thank you very mauch!
Nov 17 '05 #1
2 1269
On Tue, 12 Apr 2005 12:32:05 -0700, "#define??? ?"
<de****@discuss ions.microsoft. com> wrote:
#define RGB(r,g,b)((COL ORREF)((BYTE)(r )| \

((WORD)((BYTE)( g))<<8))| \

((DWORD)(BYTE)( b))<<16)))

what is the "| \" mean above?

who give me a answer? Thank you very mauch!


The "|" is the OR operator. The "\" allows the macro to continue on
the next line.

--
Phillip Crews aka Severian
Microsoft MVP, Windows SDK
Posting email address is real
Nov 17 '05 #2
I could be mistaken, but I believe the \ is for line continuation. The | is
bitwise OR.

Interestingly enough, this will actually make b the high value, resulting in
a BGR value, not RGB. BGR is the order in which VB6 uses the values, but I
thought most systems put red high like HTML does.
--
Daniel Wilson
Senior Software Solutions Developer
Embtrak Development Team
http://www.Embtrak.com
DVBrown Company

"#define??? ?" <de****@discuss ions.microsoft. com> wrote in message
news:28******** *************** ***********@mic rosoft.com...
#define RGB(r,g,b)((COL ORREF)((BYTE)(r )| \

((WORD)((BYTE)( g))<<8))| \

((DWORD)(BYTE)( b))<<16)))

what is the "| \" mean above?

who give me a answer? Thank you very mauch!

Nov 17 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

18
8930
by: Bryan Parkoff | last post by:
"#define" can only be inside the global scope before main() function. "#if" can be tested after "#define" is executed. The problem is that "#define" can't be inside main() function. I do not wish to create multiple functions which they look almost identical in C++ source code. The C++ compiler should be able to compile one Test() function into two almost identical functions before they are translated into the machine language object. ...
2
5594
by: Andreas | last post by:
Hi! I'm using an IplImage library from camellia.sourceforge.net, and the testbench calls a file only containing code like the one below. In cam_morphomaths_code.c the real computation is made, but I don't understand where cam_morphomaths_code.c is included and how to set what parameters to use in the testbench. How does this code execure? I don't understand a bit...
3
10584
by: theotyflos | last post by:
Hi all, I have the following: /*--- SNIP ---*/ typedef struct Argument_s { char *address; int type;
9
3095
by: pozz | last post by:
Hi all, I have the below #defines #define NUMBER1 30 #define NUMBER2 50 #define SUM (NUMBER1+NUMBER2) #define STRING1 "Byte: \x30" #define STRING2 "Byte: \x50" If I change NUMBER1 and NUMBER2 I must change STRING1 and STRING2 consequently.
34
3216
by: BQ | last post by:
Hello Is there a way to declare 'FUNCT' via a define so that if its parameter x, a constant, is greater than 35, it returns 56, if not, 20. I would like that at compile time, not at run time. So: #define FUNCT(x) x>35?56:20
17
2780
by: niraj.tiwari | last post by:
What is meaning of the following define:- #define x(argl...) x1(##argl)
71
33231
by: David T. Ashley | last post by:
Where is the best place to define TRUE and FALSE? Are they in any of the standard include files, ever? Do any standards apply? What I've traditionally done is something like: #ifndef (TRUE) #define TRUE (1)
6
27887
by: anirbid.banerjee | last post by:
Hi, I need to write a macro which would have a lot many conditional #ifdef ... #endif blocks in it. #define _xx_macro (x) { ... \ ... \ /* some code (); */ #ifdef _SOME_STMT \ ... \ ... \
23
3922
by: anon.asdf | last post by:
Hello! In the following code-snippet, is it possible to initialize each element of arr, with STRUCT_INIT? struct mystruct { int a; char b; };
2
2301
by: badc0de | last post by:
Hello.. a header file of one of my project has macro definitions like this (for example) #define PART_A_SORT_1_LABEL_STRING1 100 #define PART_A_SORT_1_LABEL_STRING2 200 #define PART_A_SORT_1_LABEL_STRING3 300 #define PART_A_SORT_1_LABEL_STRING4 400 #define PART_A_SORT_1_LABEL_STRING5 500
0
9643
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9480
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10313
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10081
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9946
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
5511
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4044
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3643
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2875
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.