recalc method

This element is obsolete and should no longer be used. Recalculates all dynamic properties in the current document.

Syntax

HRESULT retVal = object.recalc(fForce);

Parameters

fForce [in, optional]

Type: VARIANT_BOOL

A VARIANT_BOOL that specifies one of the following values.

VARIANT_FALSE (false)

Default. Recalculates only those expressions that have changed since the last recalculation.

VARIANT_TRUE (true)

Recalculates all expressions in the document.

Return value

Type: HRESULT

If this method succeeds, it returns S_OK. Otherwise, it returns an HRESULT error code.

Standards information

There are no standards that apply here.

Remarks

Implicit dependencies, internal property changes, and related properties can cause some expressions not to recalculate, even though the referenced properties might have changed. For example, resizing the main window changes the IHTMLElement2::clientWidth property. Expressions that reference IHTMLElement2::clientWidth might not be recalculated, because the change might not be recognized.

Implicit dependencies refer to properties that can be modified by changes in other properties. For example, the IHTMLScreen::height property of a div object implicitly depends on the IHTMLElement::innerHTML property of the div object. However, if an expression references the IHTMLScreen::height property, a change in the IHTMLElement::innerHTML property, which might modify the IHTMLScreen::height, does not cause a recalculation of the expression on a subsequent call to IHTMLDocument3::recalc.

Related properties can access or manipulate data or behaviors through one or more other properties. For example, IHTMLStyle::pixelLeft and IHTMLStyle::posLeft can set or get the left position of the element. However, if an expression that references IHTMLStyle::pixelLeft and IHTMLStyle::posLeft is modified, the expression might not be recalculated on subsequent calls to IHTMLDocument3::recalc.

Related properties that can cause this behavior include the following: IHTMLElement2::clientHeight, IHTMLElement2::clientLeft, IHTMLElement2::clientTop, IHTMLElement2::clientWidth, IHTMLScreen::height, IHTMLRuleStyle::left, IHTMLElement::offsetHeight, IHTMLElement::offsetLeft, IHTMLElement::offsetTop, IHTMLElement::offsetWidth, IHTMLStyle::pixelHeight, IHTMLStyle::pixelLeft, IHTMLStyle::pixelTop, IHTMLStyle::pixelWidth, IHTMLStyle::posHeight, IHTMLStyle::posLeft, IHTMLStyle::posTop, IHTMLStyle::posWidth, and IHTMLRuleStyle::top.

To force the recalculation of all expressions, refer to the same property name or manually call IHTMLDocument3::recalc(true).

See also

Reference

IHTMLStyle2::getExpression

IHTMLElement2::removeExpression

IHTMLElement2::setExpression

Conceptual

About Dynamic Properties