MFC network address control使用
控件和m_ip关联
CIPAddressCtrl m_ip.SetAddress(127,0,0,1);//初始化 可写在OnInitDialog
CString ip;
m_ip.GetWindowText(ip);//获取IP字符串
这个值可以直接作为inet_addr(ip)的输入
SOCKADDR_IN serverAddr; serverAddr.sin_family=AF_INET; serverAddr.sin_addr.s_addr=inet_addr(ip);//ip serverAddr.sin_port=htons(port);//port iRet=::connect(s,(sockaddr*)&serverAddr,sizeof(serverAddr));