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......
//create the new pen
//borrow dc from main window
//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