As title, I use CDC tool to painting text, as follow code, and use the nXOffset variable to shift location to align my text, but result of shift length is deference in windows 7 and windows xp, windows 7 is OK, but window xp does not my expectation. How to solve it, and what kind of problem to make it ?
CDC* m_cdcRealTimeValue;
m_cdcRealTimeValue->SelectObject(&mFont);
m_cdcRealTimeValue->SetTextColor(colorText);
m_cdcRealTimeValue->TextOut(rectRealTime.Width() - nXOffset,
(int)(nRealTimeRg[1] + nYGapRealTime[0]), strTempPVLastMove.Left(nPreDot), strTempPVLastMove.Left(nPreDot).GetLength());
You can calculate the text rect and shift accordingly: