본문 바로가기
C++

CString increment code

by 사무실 꿀벌 2020. 12. 15.
반응형

example

CString strIndex = _T("A");
int addIndexNum = 1;	// Use as many numbers as you like.
				//Change to match encoding ( LPWSTR, LPCWSTR -> LPSTR, LPCSTR )
strIndex.Format(_T("%c"), ((*(LPWSTR)(LPCWSTR)(strIndex)) + addIndexNum));	

// result  CString is A  to  B

 

반응형

'C++' 카테고리의 다른 글

MS WORD AUTOMATION  (0) 2023.02.16
How to remove the console window  (0) 2020.12.01
다이얼로그 숨김  (0) 2020.07.16
CFile Function Write()  (0) 2020.06.24
MFC ListControl Func  (0) 2020.06.23