IHTMLLocation

IHTMLLocation


This interface contains information about the current URL.

IHTMLLocation Methods
put_href   get_href   put_protocol  
get_protocol   put_host   get_host  
put_hostname   get_hostname   put_port  
get_port   put_pathname   get_pathname  
put_search   get_search   put_hash  
get_hash   reload   replace  
assign   toString  

IHTMLLocation::put_href

HRESULT put_href(
    BSTR v 
);

Sets the entire URL for the browser. Setting this property causes the browser to navigate to the location specified by the URL.

v
String specifying the URL.

See also get_href

IHTMLLocation::get_href

HRESULT get_href( 
    BSTR *p 
);

Retrieves the URL of the current browser location.

p
Address of a variable that receives the URL.

See also put_href

IHTMLLocation::put_protocol

HRESULT put_protocol( 
    BSTR v 
);

Sets the protocol portion of the URL that the browser uses to locate the item. The protocol portion, which indicates the access method, includes the initial substring of the URL up to and including the first colon.

v
String specifying the protocol.

See also get_protocol

IHTMLLocation::get_protocol

HRESULT get_protocol( 
    BSTR *p 
);

Retrieves the protocol portion of the URL that the browser uses to locate the item. The protocol portion, which indicates the access method, includes the initial substring of the URL up to and including the first colon.

p
Address of a variable that receives the protocol.

See also put_protocol

IHTMLLocation::put_host

HRESULT put_host( 
    BSTR v 
);

Sets the hostname portion of the location or URL.

v
String specifying the host name.

See also get_host

IHTMLLocation::get_host

HRESULT get_host( 
    BSTR *p 
);

Retrieves the hostname part of the location or URL.

p
Address of a variable that receives the host name. If no host name is available, this parameter receives an empty string.

See also put_host

IHTMLLocation::put_hostname

HRESULT put_hostname(
    BSTR v 
);

Sets the hostname portion of the location or URL.

v
String specifying the host name.

See also get_hostname

IHTMLLocation::get_hostname

HRESULT get_hostname(
    BSTR *p 
);

Retrieves the hostname part of the location or URL.

p
Address of a variable that receives the host name. If no host name is available, this parameter receives an empty string.

See also put_hostname

IHTMLLocation::put_port

HRESULT put_port( 
    BSTR v 
);

Sets the port number in a URL.

v
String specifying the port number.

See also get_port

IHTMLLocation::get_port

HRESULT get_port( 
    BSTR *p 
);

Retrieves the port number from the URL.

p
Address of a variable that receives the port number. If no port is specified, this parameter receives an empty string.

See also put_port

IHTMLLocation::put_pathname

HRESULT put_pathname(
    BSTR v 
);

Sets the file or object path of the URL.

v
String specifying the path.

See also get_pathname

IHTMLLocation::get_pathname

HRESULT get_pathname( 
    BSTR *p 
);

Retrieves the file or object path from the URL for the current browser location.

p
Address of a variable that receives the path.

See also put_pathname

IHTMLLocation::put_search

HRESULT put_search(
    BSTR v 
);

Sets the substring that follows the ? symbol in the current URL. This is the query string or form data.

v
String specifying the query string or form data.

See also get_search

IHTMLLocation::get_search

HRESULT get_search(
    BSTR *p 
);

Retrieves the substring that follows the ? symbol in the current URL. This is the query string or form data.

p
Address of a variable that receives the query string or form data.

See also put_search

IHTMLLocation::put_hash

HRESULT put_hash(
    BSTR v 
);

Sets the string following the # symbol in the URL.

v
String specifying the hash portion of the URL.

This property is useful for moving to a bookmark within a document. Assigning an invalid value does not cause an error.

See also get_hash

IHTMLLocation::get_hash

HRESULT get_hash(
    BSTR *p 
);

Retrieves the string following the # symbol in the current URL.

p
Address of a variable that receives the hash portion of the URL. If the URL has no hash sting, this parameter receives and empty string.

This property is useful for moving to a bookmark within a document. Assigning an invalid value does not cause an error.

See also put_hash

IHTMLLocation::reload

HRESULT reload(
     VARIANT_BOOL flag 
);

Reloads the current page.

flag
A Boolean value. TRUE sets the flag to reload the page, FALSE indicates not to reload the page.

IHTMLLocation::replace

HRESULT replace(
    BSTR bstr 
);

Replaces the current document by loading the document at the given URL. This method also removes the current document from the browser's session history.

bstr
String specifying the URL to insert into the session history.

Replacing a document causes it to no longer be accessible through the history object.

See also IOmHistory

IHTMLLocation::assign

HRESULT assign(
    BSTR bstr 
);

Sets the current location to the given URL. This method loads the given document specified by the URL if it exists.

bstr
String specifying the URL of the document to assign.

IHTMLLocation::toString

HRESULT toString( 
    BSTR *string 
);

Retrieves a string representation of the location object that is the href of the current browser location.

string
Address of a string variable that receives the href.

© 1997 Microsoft Corporation. All rights reserved. Terms of Use.