EM_STREAMOUT
4/8/2010
The EM_STREAMOUT message causes a RichInk control to pass its contents to an application-defined EditStreamCallback function. The callback function can then write the stream of data to a file or any other location that it chooses.
Syntax
EM_STREAMOUT
wParam = (WPARAM) (UINT) uFormat;
lParam = (LPARAM) (EDITSTREAM FAR *) lpStream;
Parameters
uFormat
A set of bit flags that indicate the data format and replacement options. This value must specify one of the following data formats.Flag Data format SF_TEXT
ASCII Text
SF_RTF
Rich Text Format (RTF)
SF_UTEXT
Unicode text
SF_PWI
Word Mobile (formerly Pocket Word) Ink (PWI)
lpStream
Pointer to an EDITSTREAM structure. On input, the pfnCallback member of this structure must point to an application-defined EditStreamCallback function. On output, the dwError member can contain a nonzero error code if an error occurred.When this DLL is used on the desktop computer, it is assumed that the EDITSTREAM structure contains a dwCookie of the following type.
pstm; bValue; pData; bLoss;
The RichInk Control may then modify the value of bLoss to indicate whether any data loss occurs during the input conversion. For more information about this structure, see COOKIE.
Return Value
Returns zero if there are no errors.
Remarks
#define EM_STREAMOUT (WM_USER + 74)
When you send an EM_STREAMOUT message, the RichInk control makes repeated calls to the EditStreamCallback function specified by the pfnCallback member of the EDITSTREAM structure. Each time it calls the callback function, the control passes a buffer containing a portion of the contents of the control. This process continues until the control has passed all its contents to the callback function, or until an error occurs.
The EditStreamCallback function returns the number of bytes processed. If this is not the same as the number of bytes requested, then the caller assumes an end-of-file condition has occurred.
When streaming out data as Unicode text, a NULL character always terminates the output. This in effect adds 2 bytes to the file size when streaming in Unicode text and then streaming it back out. This is not the case when streaming normal text. With normal text, no NULL character is added.
When streaming out data as SF_PWI, if there are no text formatting or ink objects contained within the document, the contents may be streamed out as pure multi-byte characters rather than binary data in order to have smaller file sizes.
Note
An important compatibility issue to consider is that previous versions of the Richink.dll required the EM_STREAMIN and EM_STREAMOUT messages to pass the format type directly rather than passing a pointer to the parameter that specifies the format type.
Requirements
Header | richink.h |
Library | richink.lib |
Windows Embedded CE | Windows CE 3.0 and later |
Windows Mobile | Pocket PC 2000 and later |