16,548
社区成员




CString strTemp;
strTemp.Format("服务端启动成功,监听端口:%d",m_nListenPort); m_listMsg.AddString(strTemp);
UpdateWindow();
CString hintMsg;
while (true) {
SOCKADDR_IN remote_addr;
SOCKET acceptSocket = accept(m_svrSocket,(LPSOCKADDR)&remote_addr,NULL);
hintMsg.Format("有客户机连接,客户机IP:%s",inet_ntoa(remote_addr.sin_addr));
m_listMsg.AddString(hintMsg);
UpdateWindow();
//--------------------------
// 其它代码
//---------------------------
}
// The pointer to my combo box.
extern CComboBox* pmyComboBox;
// Add 20 items to the combo box.
CString str;
for (int i=0;i < 20;i++)
{
str.Format(_T("item string %d"), i);
pmyComboBox->AddString( str );
}