//CString str;
//str= "@@@";//符號—漢字—數字等
WCHAR* pwch = newWCHAR[str.GetLength() * 2];
int nLeng =MultiByteToWideChar(CP_ACP,NULL,str,str.GetLength(),pwch,0);//得到轉化字長
MultiByteToWideChar(CP_ACP,NULL,str,str.GetLength(),pwch,nLeng);
pDC->SelectObject(&……);//設置字體
if(nLeng >15)//我這裏是15個字以後就換行
{
::DrawTextW(pDC->m_hDC,pwch,nLeng/2,CRect(rect1)), DT_CENTER |DT_VCENTER | DT_SINGLELINE);//對半分割
……//其他操作;
::DrawTextW(pDC->m_hDC,pwch+nLeng/2,nLeng-nLeng/2,CRect(rect2),DT_CENTER | DT_VCENTER | DT_SINGLELINE);
}
delete pwch;