|
Question : MFC CString - valid IP Address ?
|
|
I have a MFC GUI which takes an IP Address..
Its a CString and I would like to ensure that the data is a valid multicast IP Address.
Has anyone this check done previously to save time.
Thanks
|
|
Answer : MFC CString - valid IP Address ?
|
|
Use inet_addr(), it's simpler:
CString ipAddress = "127.0.0.1";
if (inet_addr((const char *)ipAddress) == INADDR_NONE) { // address is no good }
|
|
|