IHTMLObjectElement

IHTMLObjectElement


This interface inserts an object onto the HTML page.

This element is a block element.

IHTMLObjectElement Methods
get_object   get_classid   get_data  
get_recordset   put_align   get_align  
put_name   get_name   put_codeBase  
get_codeBase   get_codeType   put_code  
get_code   get_BaseHref   put_type  
get_type   get_form   put_width  
get_width   put_height   get_height  
get_readyState   put_onreadystatechange    get_onreadystatechange  
put_onerror   get_onerror   put_altHtml  
get_altHtml   put_vspace   get_vspace  
put_hspace   put_hspace   get_hspace  

IHTMLObjectElement::get_object

HRESULT get_object(
    IDispatch **p 
);

References the contained OBJECT. For instance, if the control's object model uses a conflicting name space, preceding the control's property with object resolves the conflict

p
Address of a variable that receives the interface pointer for the element.

IHTMLObjectElement::get_classid

HRESULT get_classid( 
    BSTR *p 
);

Specifies the class identifier for the OBJECT.

p
Address of a variable that receives the class identifier.

The format is: classid="clsid:controlspecificclsid "

IHTMLObjectElement::get_data

HRESULT get_data(
    BSTR *p 
);

Retrieves a URL referencing the object's data.

p
Address of a variable that receives the URL.

IHTMLObjectElement::get_recordset

HRESULT get_recordset( 
    IDispatch **p 
);

Retrieves the recordset if the object is a data provider.

p
Address of a variable that receives an interface pointer to the recordset.

IHTMLObjectElement::put_align

HRESULT put_align(
    BSTR v 
);

Specifies how the element is aligned with adjacent text.

v
String specifying the alignment. Can be one of these values:
absbottom Aligns the bottom of the element with the absolute bottom of the surrounding text. The absolute bottom is equal to the baseline of the text minus the height of the largest descender in the text.
absmiddle Aligns the middle of the element with the middle of the surrounding text. The absolute middle is the midpoint between the absolute bottom and texttop of the surrounding text.
baseline Aligns the bottom of the element with the baseline of the surrounding text.
bottom Aligns the bottom of the element with the bottom of the surrounding text. The bottom is equal to the baseline minus the standard height of a descender in the text.
left Aligns the element to the left of the surrounding text. All preceding and subsequent text flows to the right of the element. This is the default value.
middle Aligns the middle of the element with the surrounding text.
right Aligns the element to the right of the surrounding text. All subsequent text flows to the left of the element.
texttop Aligns the top of the element with the absolute top of the surrounding text. The absolute top is the baseline plus the height of the largest ascender in the text.
top Aligns the top of the element with the top of the text. The top of the text is the baseline plus the standard height of an ascender in the text.

For the INPUT element, this attribute applies only to the image type. It is undefined for all other types.

See also get_align

IHTMLObjectElement::get_align

HRESULT get_align( 
    BSTR *p 
);

Retrieves how the element is aligned with adjacent text.

p
Address of a variable that receives the alignment. Can be one of these values:
absbottom Aligns the bottom of the element with the absolute bottom of the surrounding text. The absolute bottom is equal to the baseline of the text minus the height of the largest descender in the text.
absmiddle Aligns the middle of the element with the middle of the surrounding text. The absolute middle is the midpoint between the absolute bottom and texttop of the surrounding text.
baseline Aligns the bottom of the element with the baseline of the surrounding text.
bottom Aligns the bottom of the element with the bottom of the surrounding text. The bottom is equal to the baseline minus the standard height of a descender in the text.
left Aligns the element to the left of the surrounding text. All preceding and subsequent text flows to the right of the element. This is the default value.
middle Aligns the middle of the element with the surrounding text.
right Aligns the element to the right of the surrounding text. All subsequent text flows to the left of the element.
texttop Aligns the top of the element with the absolute top of the surrounding text. The absolute top is the baseline plus the height of the largest ascender in the text.
top Aligns the top of the element with the top of the text. The top of the text is the baseline plus the standard height of an ascender in the text.

For the INPUT element, this attribute applies only to the image type. It is undefined for all other types.

See also put_align

IHTMLObjectElement::put_name

HRESULT put_name(
    BSTR v 
);

Sets the name of the control, bookmark, or application.

v
String specifying the name.

The name is used to bind the value of the control when submitting a form. The NAME is not the value that is displayed for the button, reset, and submit objects. Submitting the form submits the internally stored value, not the one displayed.

JScript allows the name to be changed at run time. This does not change the name in the programming model, in the collection of elements, but does change the name used for submitting elements.

See also get_name

IHTMLObjectElement::get_name

HRESULT get_name(
    BSTR *p 
);

Retrieves the name of the control, bookmark, or application.

p
Address of a variable that receives the name.

The name is used to bind the value of the control when submitting a form. The NAME is not the value that is displayed for the button, reset, and submit objects. Submitting the form submits the internally stored value, not the one displayed.

JScript allows the name to be changed at run time. This does not change the name in the programming model, in the collection of elements, but does change the name used for submitting elements.

See also put_name

IHTMLObjectElement::put_codeBase

HRESULT put_codeBase(
    BSTR v 
);

Sets a URL referencing where to find the implementation of the object.

v
String specifying the URL for the object implementation.

See also get_codeBase

IHTMLObjectElement::get_codeBase

HRESULT get_codeBase(
    BSTR *p 
);

Retrieves a URL referencing where to find the implementation of the object.

p
Address of a variable that receives a string specifying the URL for the object implementation.

See also put_codeBase

IHTMLObjectElement::put_codeType

HRESULT put_codeType(
    BSTR v 
);

Sets the Internet media type for the code associated with the object.

v
String specifying the Internet media type.

See also get_codeType

IHTMLObjectElement::get_codeType

HRESULT get_codeType(
    BSTR *p 
);

Retrieves the Internet media type for the code associated with the object.

p
Address of a variable that receives the Internet media type.

See also put_codeType

IHTMLObjectElement::put_code

HRESULT put_code(
    BSTR v 
);

Sets a URL referencing where to find the implementation of the object.

v
String specifying the URL.

See also get_code

IHTMLObjectElement::get_code

HRESULT get_code( 
    BSTR *p 
);

Retrieves a URL referencing where to find the implementation of the object.

p
Address of a variable that receives the URL.

See also put_code

IHTMLObjectElement::get_BaseHref

HRESULT get_BaseHref(
    BSTR *p 
);

Returns a string of the BASE href where the object tag can be found. This is often the base href of the document that the object is in, or the value set by a BASE tag.

p
Address of a string variable that receives the base href.

The BASE tag is used to ensure that your document's relative links are associated with the proper document path.


<BASE HREF="http://www.sample.com/hello.htm">

IHTMLObjectElement::put_type

HRESULT put_type(
    BSTR v 
);

Specifies the MIME type of the object. This is used to retrieve a classid for the object when no CLASSID= attribute is given.

v
String specifying the MIME type.

See also get_type

IHTMLObjectElement::get_type

HRESULT get_type(
    BSTR *p 
);

Retrieves the MIME type of the object. This is used to retrieve a classid for the object when no CLASSID= attribute is given.

p
Address of a variable that receives the MIME type.

See also put_type

IHTMLObjectElement::get_form

HRESULT get_form(
    IHTMLFormElement **p 
);

Retrieves a reference to the form the element is embedded on.

p
Address of a variable that receives an interface pointer to the form element. This parameter receives NULL if the element is not on a form.

See also IHTMLFormElement

IHTMLObjectElement::put_width

HRESULT put_width(
    VARIANT v 
);

Sets the calculated width of the element, in pixels.

v
Value specifying the width.

This property is an integer value. Although an HTML author can specify the width as a percentage, this property always specifies the width in pixels.

See also get_width

IHTMLObjectElement::get_width

HRESULT get_width(
    VARIANT *p 
);

Retrieves the calculated width of the element, in pixels.

p
Address of a variable that receives the width.

This property is an integer value. Although an HTML author can specify the width as a percentage, this property always specifies the width in pixels.

See also put_width

IHTMLObjectElement::put_height

HRESULT put_height(
    VARIANT v 
);

Sets the calculated height of the element, in pixels.

v
Value specifying the height.

If the value of the corresponding HTML attribute was set using a percentage, this property specifies the height in pixels represented by that percentage.

See also get_height

IHTMLObjectElement::get_height

HRESULT get_height(
     VARIANT *p 
);

Retrieves the calculated height of the element, in pixels.

p
Address of a variable that receives the height.

If the value of the corresponding HTML attribute was set using a percentage, this property specifies the height in pixels represented by that percentage.

See also put_height

IHTMLObjectElement::get_readyState

HRESULT get_readyState(
    long *p 
);

Retrieves the current state of an object being downloaded.

p
Address of a variable that receives the state. Can be one of these values:
complete The object is completely loaded.
interactive The object can be interacted with even though it is not fully loaded.
loading The object is currently being loaded.
unitialized The object is not created. Usually when the object is being downloaded.

Each object can independently determine which of the states it exposes.

IHTMLObjectElement::put_onreadystatechange

HRESULT put_onreadystatechange(
    VARIANT v 
);

Sets the inline script associated with the onreadystatechange event on the OBJECT element. This event is fired whenever the readyState for the object has changed.

v
VARIANT structure that contains the script to be set.

For more information on inline script, see Attaching an Event Handler in the Understanding the Event Model documentation.

See also get_onreadystatechange

IHTMLObjectElement::get_onreadystatechange

HRESULT get_onreadystatechange(
    VARIANT *p 
);

Retrieves the inline script associated with the onreadystatechange event on the OBJECT element. This event is fired whenever the readyState for the object has changed.

p
Address of a VARIANT structure that contains the script.

For more information on inline script, see Attaching an Event Handler in the Understanding the Event Model documentation.

See also put_onreadystatechange

IHTMLObjectElement::put_onerror

HRESULT put_onerror(
    VARIANT v 
);

Sets the inline script associated with the onerror event on the OBJECT element. This error event occurs when the loading of the object causes an error.

v
VARIANT structure that contains the script to be set.

For more information on inline script, see Attaching an Event Handler in the Understanding the Event Model documentation.

See also get_onerror

IHTMLObjectElement::get_onerror

HRESULT get_onerror(
    VARIANT *p 
);

Retrieves the inline script associated with the onerror event on the OBJECT element. This error event occurs when the loading of the object causes an error.

p
Address of a VARIANT structure that contains the script.

For more information on inline script, see Attaching an Event Handler in the Understanding the Event Model documentation.

See also put_onerror

IHTMLObjectElement::put_altHtml

HRESULT put_altHtml(
    BSTR v 
);

Sets the string of alternative text that could be displayed instead of the object.

v
String value specifying the alternate text.

See also get_altHtml

IHTMLObjectElement::get_altHtml

HRESULT get_altHtml(
    BSTR *p 
);

Returns the string of alternative text that would be displayed for the object if the object is unable to be instantiated, or the browser does not support objects.

p
Address of a string variable that receives the alternative text.

See also put_altHtml

IHTMLObjectElement::put_vspace

HRESULT put_vspace(
    long v 
);

Sets the amount of vertical space defined in pixels for the object

v
String value specifying the amount of vertical space.

See also get_vspace

IHTMLObjectElement::get_vspace

HRESULT get_vspace(
    long *p 
);

Returns the amount of vertical space defined in pixels for the object.

p
Address of a string variable that receives the vertical space.

See also put_vspace

IHTMLObjectElement::put_hspace

HRESULT put_hspace(
    long v 
);

Sets the amount of horizontal space defined in pixels for the object

v
String value specifying the amount of horizontal space.

See also get_hspace

IHTMLObjectElement::get_hspace

HRESULT get_hspace(
    long *p 
);

Returns the amount of horizontal space defined in pixels for the object.

p
Address of a string variable that receives the horizontal space.

See also put_hspace

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