GetPen returns a HPEN

here it is:
Code:
HPEN GetPen(long nWidth, COLORREF color)
{
	HPEN hPen_temp;
	hPen_temp = CreatePen(0,nWidth,color);

	if(hPen_temp == NULL)
		return NULL;
	else
		return hPen_temp;
}//GetPen
Do you know why it gives me that error though? on the msdn, they do that, and they don't have any type-cast.