Re: NO Bug in CRichEditCtrl::GetLine()
"hawkgao" <hawkgao-/[email protected]>
| Newsgroups | gmane.comp.windows.wtl |
|---|---|
| Message-ID | <[email protected]> |
Oh, sorry. I got it. 65536 is exceed the max of WORD type. it's 0x100000. from the view of EM_GETLINE, the buffer is ZERO! Thank you Alain! --- In [email protected], "Alain Rist" <ar@...> wrote: > > In the doc for EM_GETLINE: > 'Before sending the message, set the first word of this buffer to the size, in TCHARs, of the buffer.' > > > ----- Original Message ----- > From: hawkgao > To: [email protected] > Sent: Monday, March 09, 2009 7:13 AM > Subject: [wtl] Bug Report, in CRichEditCtrl::GetLine() > > > int GetLine(int nIndex, LPTSTR lpszBuffer, int nMaxLength) const > { > ATLASSERT(::IsWindow(m_hWnd)); > *(LPWORD)lpszBuffer = (WORD)nMaxLength; //WRONG! assign length to buffer address variable. > return (int)::SendMessage(m_hWnd, EM_GETLINE, nIndex, (LPARAM)lpszBuffer); > } > > > > > [Non-text portions of this message have been removed] > ------------------------------------ Yahoo! Groups Links <*> To visit your group on the web, go to: http://groups.yahoo.com/group/wtl/ <*> Your email settings: Individual Email | Traditional <*> To change settings online go to: http://groups.yahoo.com/group/wtl/join (Yahoo! ID required) <*> To change settings via email: mailto:[email protected] mailto:[email protected] <*> To unsubscribe from this group, send an email to: [email protected] <*> Your use of Yahoo! Groups is subject to: http://docs.yahoo.com/info/terms/