Hi Scott,
There is no concept of a
maximum length for
CString
, the length depends on the content.
If you wish to set the allocated size to avoid copying use
void CString::Preallocate(int length)
.
cheers,
AR
Edit after question update:
If you want to limit the length of accepted text for an Edit Control send it the
EM_SETLIMITTEXT
message:
::SendMessage(hWndofMyControl, EM_SETLIMITTEXT, 8, 0);