or maybe it should be Another question by a stupid VBer :)
No really... What does this code mean particularly the (BYTE)?
Thanks a mil.Code:
bmp.bmBitsPixel =
(BYTE) GetDeviceCaps(hdcScreen, BITSPIXEL);
Printable View
or maybe it should be Another question by a stupid VBer :)
No really... What does this code mean particularly the (BYTE)?
Thanks a mil.Code:
bmp.bmBitsPixel =
(BYTE) GetDeviceCaps(hdcScreen, BITSPIXEL);
It's a typecast; it converts what GetDeviceCaps returns into a BYTE.
So In Vb could I write the following?
VB Code:
bmp.bmBitsPixel = CByte(GetDeviceCaps(hdcScreen, BITSPIXEL))
Yes, but in vb the function returns long.
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
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