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