title: How to validate hostname (may be IP) and port number (CString)
body: <p>I have an dialog for HTTP proxy configuration with hostname and port edit boxes. </p>
  
  <p>My question is how can I validate user input for correct hostname and port?</p>
  
  <p>May be I have to use some regular expression for hostname validation or there is some helpful MFC or WinAPI function? What is the maximum correct number for port?</p>