Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
Export (0) Print
Expand All

IHTMLObjectElement::BaseHref Property

Retrieves a string of the URL where the object tag can be found. This is often the IHTMLBaseElement::href of the document that the object is in, or the value set by a base element.

Syntax


HRESULT IHTMLObjectElement::get_BaseHref(BSTR *p);

Parameters

p
Pointer to a variable of type BSTR that receives the URL of the object.

Return Value

Returns S_OK if successful, or an error value otherwise.

Remarks

Use the IHTMLObjectElement::BaseHref property to resolve relative paths when locating an object. The following rules determine the resulting p.

  • If the object is on a page containing a base element, then the p parameter points to a BSTR with the IHTMLBaseElement::href property value.
  • If the object is on a page with javascript, vbscript, or about  protocol  URLs, then the p parameter receives a pointer to a BSTR with the value of the current page's parent page URL. This applies to IHTMLObjectElement::BaseHref property requests in iframe/ frame elements as well.
  • For all other object elements, the parameter p points to a BSTR with the IHTMLLocation::href property value for the page they are found on.

Community Additions

Show:
© 2015 Microsoft