2009년 7월 29일 수요일

CString ASCII 변환 Key 찾기

 

CString을 한글자씩 잘라내 char* 로 변환 __toascii를 사용 ASCII로 변환

Key 13의 수량을 찾아 Enter key 를 확인한다.

 

CString strcomment;

 

for(int nSize = 0 ; nSize < strcomment.GetLength() ; nSize++)
 {
   CString strTemp = strcomment.Mid(nSize, 1);
   char* chrTemp;
   chrTemp = (LPSTR)(LPCTSTR)strTemp;
   int iAscii = __toascii(*(chrTemp));
   if(iAscii == 13)
    nCount = nCount+1;
 }

댓글 없음:

댓글 쓰기