各位前辈,本人刚接触网络编程,正在看一个聊天程序.我按照书上的代码敲进去后编译问题,请帮小弟看一下
OnConnectOpen()是一个消息响应函数,请求连接服务器
但那个ConnectDialog是怎么回事啊?
void CMainFrame::OnConnectOpen()
{
// TODO: Add your command handler code here
if(m_Socket)
{
MessageBox("OK","warning",MB_OK);
return;
}
ConnectDialog m_Dlg1;//error C2065: 'ConnectDialog' : undeclared identifier
if(m_Dlg1.DoModal()==IDOK)
{
m_ServeName=m_Dlg1.m_ServerName;//m_ServerName ,m_PortAddress都是CMainFrame的公有成员
m_PortAddress=m_Dlg1.m_PortAddress;
m_Socket=new CRequestSocket(this);
if(!(m_Socket=ConnectServer()))
{
m_Socket=NULL;
return;
}
}
}
OnConnectOpen()是一个消息响应函数,请求连接服务器
但那个ConnectDialog是怎么回事啊?
void CMainFrame::OnConnectOpen()
{
// TODO: Add your command handler code here
if(m_Socket)
{
MessageBox("OK","warning",MB_OK);
return;
}
ConnectDialog m_Dlg1;//error C2065: 'ConnectDialog' : undeclared identifier
if(m_Dlg1.DoModal()==IDOK)
{
m_ServeName=m_Dlg1.m_ServerName;//m_ServerName ,m_PortAddress都是CMainFrame的公有成员
m_PortAddress=m_Dlg1.m_PortAddress;
m_Socket=new CRequestSocket(this);
if(!(m_Socket=ConnectServer()))
{
m_Socket=NULL;
return;
}
}
}
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货