CString——GetBuffer的用法例子

来源:互联网 发布:网站seo外链 编辑:程序博客网 时间:2024/05/22 06:07

void CClientSocket::OnReceive(int nErrorCode)
{
 // TODO: Add your specialized code here and/or call the base class

 if(!nErrorCode)
 {
  CString msg;
  const int BUF_SIZE = 4096;
  Receive((void*)msg.GetBuffer(BUF_SIZE),BUF_SIZE);
  msg.ReleaseBuffer();
  
  m_pDlg->m_strText += msg;
  m_pDlg->RefreshScreen();
 }

 CSocket::OnReceive(nErrorCode);
}

原创粉丝点击