CIPAddressCtrl控件

CIPAddressCtrl m_ipCtrl;

1、获取控件IP值

int GetAddress(byte& byteFirst, byte& byteTwo, byte& byteThree, byte& byteFour); 
int GetAddress(DWORD& dwAddress); 

 

byte byteIP[4];

(1).m_ipCtrl.GetAddress(byteIP[0], byteIP[1], byteIP[2], byteIP[3]);

CString转byte

CString strIPAddress;

m_ipCtrl.GetWindowText(strAddress);

(2).sscanf(strAddress, "%d.%d.%d.%d",  &byteIP[0], &byteIP[1], &byteIP[2], &byteIP[3]);

 

2、设置IP控件值

void SetAddress(byte& byteFirst, byte& byteTwo, byte& byteThree, byte& byteFour); 
void SetAddress(DWORD dwAddress); 

m_ipCtrl.SetAddress(参数1, 参数2, 参数3, 参数4);

CStirng strIP(参数IP);

m_ipCtrl.SetWindowText(strIP);

 

3、清空IP控件内容

m_ipCtrl.ClearAddress();

 

4、判断IP控件是否为空

m_ipctrl.IsBlank();

posted @ 2014-10-07 22:13  风狼啸天  阅读(314)  评论(0编辑  收藏  举报