CUrl Class
Collapse the table of content
Expand the table of content

CUrl Class

This class represents a URL. It allows you to manipulate each element of the URL independently of the others whether parsing an existing URL string or building a string from scratch.

class CUrl

CUrl allows you to manipulate the fields of a URL, such as the path or port number. CUrl understands URLs of the following form:


(Some fields are optional.) For example, consider this URL:

CUrl::CrackUrl parses it as follows:

  • Scheme: "http" or ATL_URL_SCHEME_HTTP

  • UserName: "someone"

  • Password: "secret"

  • HostName: ""

  • PortNumber: 80

  • UrlPath: "visualc/stuff.htm"

  • ExtraInfo: "#contents"

To manipulate the UrlPath field (for instance), you would use GetUrlPath, GetUrlPathLength, and SetUrlPath. You would use CreateUrl to create the complete URL string.

Header: atlutil.h

Community Additions

© 2016 Microsoft