Programming Tips - MFC: How can I check if a URL is valid?

Date: 2013sep5 Language: C++ Framework: MFC Q. MFC: How can I check if a URL is valid? A.
BOOL isValidUrl(LPCSTR szUrl) { DWORD dwServiceType = 0; CString strServer; CString strObject; INTERNET_PORT port = 0; return AfxParseURL(szUrl, dwServiceType, strServer, strObject, port); }