반응형 IT창고/MFC15 string 계산 로직 void Ctest2View::OnBnClickedButton1() { // TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다. CString str; int ndxPrev, ndxNext, ndxEnd; CString temp1, temp2, temp3; str.Format("a||1||b||2||c||3"); for(int i=1; i 2008. 2. 14. MFC 로 구현한 문자열 단어단위 역순 출력 CString str; CString token; CStringArray rev_str; int curPos= 0; str.Format(_T("Do or do not. there is no try")); str.MakeReverse(); while ((token = str.Tokenize(" ", curPos)) != "") { rev_str.Add(token); } int ndx = rev_str.GetSize(); CString result; CString word_format; while(ndx) { word_format.Format("%s ", rev_str[ndx-1]); result += word_format; ndx--; } AfxMessageBox(result); 2008. 2. 13. 파일 타입 알아 내기 SHGetFileInfo ( szNextFile, 0, &rFileInfo, sizeof(rFileInfo), SHGFI_SYSICONINDEX | SHGFI_ATTRIBUTES | SHGFI_TYPENAME ); rFileInfo.szTypeName 2007. 11. 8. CString -> char * CString -> char * CString spi = _T("123"); char temp[100]; WideCharToMultiByte(CP_ACP, 0, spi.GetBuffer(spi.GetLength()) , spi.GetLength(), temp, spi.GetLength(), NULL, NULL); i_spi = atoi(temp); char * --> CString char ss[] = "Hello"; CString str; str.Format("%s", ss); (Format대신에 GetBuffer()를 써도 됩니다.) 2007. 1. 22. 이전 1 2 3 4 다음