An Internet Protocol (IP) address control allows the user to enter an IP address in an easily understood format.

How can we Set/Get an IP address from an CIPAddressCtrl?

MFC provides two methods like CIPAddressCtrl::GetAddress() and CIPAddressCtrl::SetAddress() for getting and setting data from/to the control.

You can also set/get an IP Address by using one more simple method.

Let me provide one clue here. πŸ˜‰

class CIPAddressCtrl : public CWnd
{
}

Got anything ?? Neh ?? πŸ™‚

Ok.. no problem..

class CIPAddressCtrl is derived from CWnd. so..??

SetWindowText() and GetWindowText() is a member of CWnd. πŸ™‚

So you can easily set/get data to/from IPAddressCtrl.

like this..

CString csIPAddress(_T("255.125.25");
CIPAddressCtrl ipAddressCtrl;
ipAddressCtrl.SetWindowText(csIPAddress);

also

ipAddressCtrl.GetWindowText(csIPAddress);

πŸ™‚

Thanks to my buddy..

Keep smiling Always πŸ™‚

 If the facts don't fit the theory, change the facts!
for https://vctipsplusplus.wordpress.com/
BijU
Advertisements