In MSDN, it says the lParam content of the EM_GetLine message should be:
But in all the examples I've found, lParam is always listed as just a pointer to the variable, with no code that shows insertion of the size in the first word of buffer, like this:
Why is that?
lParam A pointer to the buffer that receives a copy of the line. Before sending the message, set the first word of this buffer to the size, in TCHARs, of the buffer. For ANSI text, this is the number of bytes; for Unicode text, this is the number of characters. The size in the first word is overwritten by the copied line.
Code:
lnLen = SendMessage(hEdit, %EM_GETLINE, ln, STRPTR(Buf)) 'Get line
Comment