The problem has nothing to do with MFC but is inherent in the underlying Windows GDI function. The documentation for LineTo
says:
The LineTo function draws a line from the current position up to, but not including, the specified point.
If you need the last point drawn, you should do a second LineTo
one pixel away from the first.