VXPLib Documentation: COM

IVXPQuickHTML::GetBodyAttr

Returns an attribute value specified in tag <BODY>.
HRESULT GetBodyAttr(BSTR attrName, VXPTagAttribute attrType = taText, VARIANT * Value);
Parameters
attrName [in] - Name of the attribute. This function is not case-sensitive to the attribute name, and it ignores spaces.
attrType [in, defaultvalue(taText)] - Type to which the return value must be converted (see remarks)
Value [out, retval] - Pointer to a VARIANT variable to return value of the attribute
Remarks
The function searches for an attribute with name attrName defined in tag <BODY> of the component, and if it finds the attribute returns its contents in a requested format.
Supported formats are defined as type VXPTagAttribute:
TypeDescription
taTextSimple text string
taColorColor value
taByte1-byte value: 0 to 255, or -128 to 127
taShort2-byte integer value: -32,768 to 32,767
taLong4-byte long integer value: -2,147,483,648 to 2,147,483,647
taFloat4-byte floating point value: 3.4E +/- 38 (7 digits)
taDouble8-byte double precision value: 1.7E +/- 308 (15 digits)
taPercent1-byte percent value: 0% to 100%
taBooleanBoolean value
taDateTimeDate/Time value
Note: Tag attribute types taBoolean and taDateTime use text values in a language available on your computer by default. They were implemented through API functions VarDateFromStr and VarBoolFromStr using LANG_USER_DEFAULT in both cases for the LCID parameter, thus allowing for all possible languages when recognizing attribute values.

The function returns values of both standard and custom attributes. When the attribute is not found or not specified in tag <BODY> the function returns an empty value.
One example of application: When an object uses QHTML it may retrive extra parameters for its own initialization using this function instead of hardcoding initialization parameters for the object.
See Also
IVXPQuickHTML Overview | GetControlAttr | GetControlAttrIdx | <BODY>
This document was last updated on 19/05/2003
Copyright © 2003 Tooltips.NET