Click to return to the Reusing Browser Technology home page    
IHTMLDocument2::toString ...     IHTMLDocument2::writeln M...     IHTMLDocument2 Interface    
Web Workshop  |  Reusing Browser Technology

IHTMLDocument2::write Method


Writes one or more HTML expressions to a document in the specified window.

Syntax

HRESULT write(
    SAFEARRAY *psarray
);

Parameters

psarray
Address of a safe array that contains the text and HTML tags to write.

Return Value

Returns S_OK if successful, or an error code otherwise.

Windows CE

Windows CE Use version 2.12 and later
Minimum availability Internet Explorer 4.0

Example

IHTMLDocument2 *document; // Declared earlier in my code
HRESULT hresult = S_OK;
VARIANT *param;
SAFEARRAY *sfArray;
BSTR bstr = SysAllocString(OLESTR("some string"));

sfArray = SafeArrayCreateVector(VT_VARIANT, 0, 1); // Creates a new one-dimensional array
if (sfArray == NULL || document == NULL) {
goto cleanup;
}

hresult = SafeArrayAccessData(sfArray,(LPVOID*) & param);
param->vt = VT_BSTR;
param->bstrVal = bstr;
hresult = SafeArrayUnaccessData(sfArray);
hresult = document->write(sfArray);

cleanup:
SysFreeString(bstr);
if (sfArray != NULL) {
SafeArrayDestroy(sfArray);
}

See Also

writeln


Back to topBack to top

Did you find this topic useful? Suggestions for other topics? Write us!

© 1999 Microsoft Corporation. All rights reserved. Terms of use.