in sams teach yourself visual c++ 6 in chapter 9 as the first exercise they want you to modify the mousetst program to display the current mouse position as the mouse is moved over the view. I modified the code to do this and what happens is as soon as the program window comes up with the mouse over it (or if you start the program with the mouse view outside the area of the program window and move the mouse across the window) the window that tells you the program had an error and asks if you want to send the problem to microsoft will come up. Here's the pertinent code (if you need to see other parts of the program, let me know. This is just one function.
void CMouseTstView::OnMouseMove(UINT nFlags, CPoint point, CDC* pDC)
// TODO: Add your message handler code here and/or call default
m_ptMouse = point;
CString coordinates = (CString)m_ptMouse.x;
coordinates += "," + (CString)m_ptMouse.y;
pDC->TextOut(m_ptMouse.x, m_ptMouse.y, "stringy");
I'm not even sure that the coordinates variable would print because I'm not sure about typecasting with these types. It is supposed to print the coordinates while you have the mouse over the window.