I don't understand how to use DPtoLP funciton correctly. I left my Petzold book at home, and I can't seem to find it on msdn.
I'm using MM_TWIPS map mode so all I have to do is multiply user input by 1440 to get inches for my output to the screen.
What function should I use: cxClient from WM_SIZE or GetClientRect to get the size of the client area? Either way I need to convert to something usefull so that I can implement a zoom to fit the screen function.
Any suggestions would be appreciated, and hopefully this question makes some sense to you all
Code:
GetClientRect (hwnd, &rect); // Device Units...
sprintf(str, "GetClientRect rect.right in Device units = %d", rect.right);
MessageBox(hwnd,str,"coord",MB_ICONINFORMATION);
// This always returns 210.
DPtoLP (hDC,(PPOINT) &rect, 2);
sprintf(str, "GetClientRect rect.right after DPtoLP = %d", rect.right);
MessageBox(hwnd,str,"coord",MB_ICONINFORMATION);
// This always returns 210.
// This gives me dims in pixels and works correctly.
sprintf(str,"cxClient from WM_size = %d", cxClient);
MessageBox(hwnd,str,"WM SIZE",MB_ICONINFORMATION);