|
-
Oct 12th, 2001, 04:05 PM
#1
Thread Starter
Addicted Member
Another stupid question by a VBer
or maybe it should be Another question by a stupid VBer 
No really... What does this code mean particularly the (BYTE)?
Code:
bmp.bmBitsPixel =
(BYTE) GetDeviceCaps(hdcScreen, BITSPIXEL);
Thanks a mil.
-
Oct 12th, 2001, 04:10 PM
#2
Member
It's a typecast; it converts what GetDeviceCaps returns into a BYTE.
-
Oct 12th, 2001, 04:17 PM
#3
Thread Starter
Addicted Member
So In Vb could I write the following?
VB Code:
bmp.bmBitsPixel = CByte(GetDeviceCaps(hdcScreen, BITSPIXEL))
-
Oct 12th, 2001, 08:07 PM
#4
Frenzied Member
Yes, but in vb the function returns long.
-
Oct 12th, 2001, 09:03 PM
#5
PowerPoster
it is a typecast so it has be in the following format in C++:
PHP Code:
(TYPECAST)
//So if you want to return a specific type of value then
//for byte
(BYTE)
//for a handle
(HWND)
//and there are lots of others
-
Oct 12th, 2001, 10:09 PM
#6
Code in C++ uses a lot of casting and special datatypes - which all are really one of a few datatypes, just like in VB.
ANY declaration that is in caps is one of these things
LPCSTR
BYTE x; <- dim x as Byte (signed ie, -127 - +127, with no negative numbers
(BYTE) <- type cast
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|