Ok, so the book I used wasn't really clear on casting, but now the graphics programming book that I have talk about it....for example the following line......
Code:
bool Prog_Init()
{
//create the new pen
hpenNew=CreatePen(PS_SOLID,0,RGB(255,255,255));
//borrow dc from main window
HDC hdc=GetDC(hWndMain);
//select new pen into dc
hpenOld=(HPEN)SelectObject(hdc,hpenNew);//it says that the assignment to the hpenOld is a cast of something,
can you shed some light into this? Why is this necessary?
//release dc to system
ReleaseDC(hWndMain,hdc);
return(true);//return success
}