Those two attributes are intended for the same purpose, which is to limit the amount of text that can be entered interactively in the text box (but keep in mind, that you can still enter text programmatically, using SetCtrlVal, that is longer than those limits).
The reason there are two attributes is because for one you specify the limit in bytes (MAX_ENTRY_LENGTH) and for the other you specify the limit in characters (MAX_ENTRY_CHARS). In the ANSI character set, bytes and characters are the same, but there are character sets such as Japanese and Korean, in which a single character can be 1 or 2 bytes.
Now, about that error you're having...
Since you set the limit to 79 characters, and assuming that you're running this code in a non-multibyte system, an 80-byte array should be sufficient to hold the text (you do need an extra byte for the NULL character). The obvious question is, how many characters are actually visible in the textbox at the time you call GetCtrlVal? Are there 79 characters in there, or 82 (including line feeds)? If there are more than 79 characters, how did the text get in there? Was it typed in, or was it set programmatically? Also, if instead of setting ATTR_MAX_ENTRY_CHARS to 79, you were to set ATTR_MAX_ENTRY_LENGTH to 79, would that change anything?
Luis
NI