Jump to content

MLM IMPORT

From EDM2
Revision as of 04:31, 25 April 2025 by Martini (talk | contribs)
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

This message imports text from a buffer.

Syntax

param1
PIPT * pBegin;    /* Insertion point. */

param2
ULONG ulCopy;     /* Number of bytes in buffer. */

Parameters

pBegin (PIPT) - input/output
Insertion point. Updated to insertion point following last insert.
ulCopy (ULONG) - input
Number of bytes in buffer.

Returns

ulSuccess (ULONG) - return
Number of bytes successfully inserted.

Remarks

This message takes an insertion point and length as parameters. It assumes a buffer has been set using MLM_SETIMPORTEXPORT, and inserts the contents of the buffer at the insertion point in the text. The contents are interpreted as being in the format set by MLM_FORMAT. If the insertion point is -1, the cursor point is used.

The insertion point pBegin is updated by the MLE to the point after the last character imported. This provides the application with the location for the next import.

The return value indicates how many bytes were actually transferred.

All imports are done in full characters, therefore, if the number of bytes to be imported results in the last byte transferred being only half of a DBCS character, or part of a line-break sequence (CR LF or CR CR LF), the MLE does not transfer that byte. If the return value indicates that less than the full amount was transferred, a check must be made to determine if it is the beginning of a multi-byte sequence, and if so, the parts must be mated and imported as a whole.

This can cause an overflow, see MLN_OVERFLOW.

Note
The buffer is not zero-terminated; NULL characters can be inserted into the text.

Default Processing

The default window procedure takes no action on this message, other than to set ulSuccess to 0.