How to getting the string of head position??
-
hi i have a promblem that i have a string "首YはYO二OK亜KM。M" i want get the & of head but i can't getting the right~ like this: CString m_str="首YはYO二OK亜KM。M"; wchar_t *m_T=(LPWSTR)_bstr_t(m_str); wchar_t m_tem=*m_T; fontOld=pDC->SelectObject(pFont); pDC->TextOut(rc.left+m_Width,rc.top+m_Depth,&m_tem); but it display 首???????? i only want 首 thank in advance very much.:confused::confused::confused::confused: nothing
-
hi i have a promblem that i have a string "首YはYO二OK亜KM。M" i want get the & of head but i can't getting the right~ like this: CString m_str="首YはYO二OK亜KM。M"; wchar_t *m_T=(LPWSTR)_bstr_t(m_str); wchar_t m_tem=*m_T; fontOld=pDC->SelectObject(pFont); pDC->TextOut(rc.left+m_Width,rc.top+m_Depth,&m_tem); but it display 首???????? i only want 首 thank in advance very much.:confused::confused::confused::confused: nothing
-
hi i have a promblem that i have a string "首YはYO二OK亜KM。M" i want get the & of head but i can't getting the right~ like this: CString m_str="首YはYO二OK亜KM。M"; wchar_t *m_T=(LPWSTR)_bstr_t(m_str); wchar_t m_tem=*m_T; fontOld=pDC->SelectObject(pFont); pDC->TextOut(rc.left+m_Width,rc.top+m_Depth,&m_tem); but it display 首???????? i only want 首 thank in advance very much.:confused::confused::confused::confused: nothing
-
hi i have a promblem that i have a string "首YはYO二OK亜KM。M" i want get the & of head but i can't getting the right~ like this: CString m_str="首YはYO二OK亜KM。M"; wchar_t *m_T=(LPWSTR)_bstr_t(m_str); wchar_t m_tem=*m_T; fontOld=pDC->SelectObject(pFont); pDC->TextOut(rc.left+m_Width,rc.top+m_Depth,&m_tem); but it display 首???????? i only want 首 thank in advance very much.:confused::confused::confused::confused: nothing
TextOut displays a string, not a character. Passing
&m_tem
, TextOut still treats it as a string and, as such, is exactly the same asm_T
. By the way, as has been alluded, CString doesn't like to be messed with internally like you might be trying. Use achar
array instead, or you're going to blow something up later. Bob Ciora