Bug fixed in drawing lines: repalced PS_ENDCAP_SQUARE with PS_SOLID.
PS_ENDCAP_SQUARE is not supported by WindowsCE.