본문 바로가기

Programming/MFC

2바이트 특수문자를 띄우기

CStringW wstr ;
wstr.Format( L"%d° %d' %d''", 3, 20, 5 ) ;
 
wchar_t* p3 = (LPWSTR)(LPCWSTR)wstr ;

 

 MessageBoxW( this->GetSafeHwnd(), p3, NULL, MB_OK ) ; 

 ::SetWindowTextW( GetDlgItem(IDC_EDIT1)->GetSafeHwnd(), p3) ;
 ::SetWindowTextW( GetDlgItem(IDC_STATIC_TEST)->GetSafeHwnd(), p3 ) ;


m_ctrl_list_test.InsertColumn( 0, _T("test"), LVCFMT_CENTER, 200 ) ; 
LVITEMW item ;
item.mask = LVIF_TEXT | LVIF_IMAGE ;
item.iItem = 0 ;
item.iSubItem = 0 ;
item.pszText = (LPWSTR)(LPCWSTR)p3 ;
::SendMessageW( m_ctrl_list_test.GetSafeHwnd(), LVM_INSERTITEMW, 0, (LPARAM)&item ) ;  
::SendMessageW( m_ctrl_list_test.GetSafeHwnd(), LVM_SETITEMW, 0, (LPARAM)&item ) ;