我想在子窗口初始化IP控件,编译过了,但弹出子窗口时报错!
我已经能确定是IP控件初始化语句的问题,该语句删掉后正常!
现在需要怎么改???!
本人刚学习编程,望好心人解答!
代码如下:
 
#include "stdafx.h"
#include "Demighter Training Platform.h"
#include "SETCONNECT.h"#pragma comment(lib, "WS2_32.lib")#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif/////////////////////////////////////////////////////////////////////////////
// SETCONNECT dialog
SETCONNECT::SETCONNECT(CWnd* pParent /*=NULL*/)
: CDialog(SETCONNECT::IDD, pParent)
{
//{{AFX_DATA_INIT(SETCONNECT)
m_uLocalPort = 5001;
m_uTargetPort = 4001;
m_aLocalIP.SetAddress(ntohl(inet_addr("192.168.0.101")));
//}}AFX_DATA_INIT
}
void SETCONNECT::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(SETCONNECT)
DDX_Control(pDX, IDC_TARGETIP, m_aTargetIP);
DDX_Control(pDX, IDC_LOCALIP, m_aLocalIP);
DDX_Text(pDX, IDC_LOCALPORT, m_uLocalPort);
DDV_MinMaxUInt(pDX, m_uLocalPort, 1024, 100000);
DDX_Text(pDX, IDC_TARGETPORT, m_uTargetPort);
DDV_MinMaxUInt(pDX, m_uTargetPort, 1024, 100000);
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(SETCONNECT, CDialog)
//{{AFX_MSG_MAP(SETCONNECT)
ON_BN_CLICKED(IDC_BUTTON3, OnButton3)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()