Magazine |
| | Community |
| | Workshop |
| | Tools & Samples |
| | Training |
| | Site Info |
|
|
||||||||
|
Writes one or more HTML expressions to a document in the specified window.
Syntax
HRESULT write( SAFEARRAY *psarray );
Return Value
Returns S_OK if successful, or an error value otherwise.
Parameters
- psarray
- Address of a safe array containing the text and HTML tags to write.
Example code
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
Does this content meet your programming needs? Write us!
© 1998 Microsoft Corporation. All rights reserved. Terms of use.