블로그 이미지
생각처럼

카테고리

전체보기 (209)
TOOL (1)
다이어리 (1)
Bit (200)
HELP? (0)
Total
Today
Yesterday

달력

« » 2025.2
1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28

공지사항

태그목록

최근에 올라온 글

CCesocket 클래스를 상속하여 소켓을 생성하였더니

Csocket 으로 상속하였을때는 안되던 이벤트들이 먹히기 시작했다 신기하다....

ce 프로그래밍시 소켓클래스는 CCesocket 클래스를 상속해야만 하는건가??

 

void CSocket_C::OnReceive(int nErrorCode) 
{
 // TODO: Add your specialized code here and/or call the base class
 
 ((CClientApp*)AfxGetApp())->ReceiveData(); // 데이터를 읽는다.
 CAsyncSocket::OnReceive(nErrorCode);
}

 

 

void CClientApp::ReceiveData()
{
 char temp[1000];
 CString strText;
 client_s->Receive(temp, sizeof(temp));

 UINT    nPort;
 client_s->GetPeerName(strText, nPort); // 상대방의 IP 주소와 포트 번호 얻음
 strText = "[ " + strText + " ] " + temp;
 //((CListBox*)m_pMainWnd->GetDlgItem(IDC_CLIST))->InsertString(-1, strText);
 //CClientDlg* mf = (CClientDlg*)::AfxGetMainWnd();
 //mf->m_list = temp;
 ((CEdit*)m_pMainWnd->GetDlgItem(IDC_CLIST))->ReplaceSel(strText,TRUE);
}

Posted by 생각처럼
, |

최근에 달린 댓글

최근에 받은 트랙백

글 보관함