// CString -> wchar_t * -_-;;;;; 이상함..;; CStringW aaa(_T("hello!")); wchar_t *a = (wchar_t *)aaa.GetBuffer(); MessageBoxW(NULL, a, a, 0); //이것도.... 되긴되는데..;;;; wchar_t wTemp[1024] = L"\0"; MultiByteToWideChar(CP_ACP, 0, m_szNotice,m_szNotice.GetLength(),wTemp,1024); // wchar_t * -> CString 변환 wchar_t *aaa = L"Hello, World!"; CString temp(aaa); m_szText = temp;
CString -> char (포인터 값으로 저장) CString str = "Hello"; char * ch = NULL; ch = (LPSTR)(LPCSTR)str; 또는 ch = str.GetBuffer(str.GetLength()); // str의 포인터 값을 ch에 저장한다. CString -> char (배열에 복사) CString str = "Hello"; char ch[100] = {0,}; memcpy(ch, (LPSTR)(LPCSTR)str, str.GetLength()); // NULL을 만나기 전까지의 문자를 str에서 ch로 복사한다. char -> CString char ch[] = "Hello"; CString str; str.Format("%s", ch); // NULL을 만..
이거 하나 에러나는데 엄청난 -_-ㅋ 삽질을 했다. 지금 새벽 4시니깐 ㅡ.ㅡa 분명 저녁먹고나서 계속 IniFile 클래스를 만지작 거렸으니... 8시간동안 붙잡고 있었다는 ㅜㅜ... 지금 부터 그 문제를 - 알아보자. ! /////////////////////////////////////////////////////// // vs2005 MFC 를 이용하였습니다. /////////////////////////////////////////////////////// // CString 를 사용함! CString bitsIndexStr, zeroStr, oneStr; CString headStr; // fscanf() 를 이용하여 CString 의 변수에 값을 넣음 fscanf(stream, "%S", h..
...... 할말이 없다 -_- 자료형변환 왜이리도 짜증이 나는지... CString szValue; double lValue=0.0; // 해결방법 lValue = _wtof(szValue); // Error!! lValue = atof(LPSTR(LPCTSTR(szValue))); // 참고로 _wtoi() 함수는 정수로 변환을 해준다. _wtof() 함수를 쓰니 한번에 해결이 되었다. 이거 -_-; 하나 찾는데 얼마나 오래걸리는지.. 으아 ㅡㅡ++