Getting the text from CEdit, I need help? 
Author Message
 Getting the text from CEdit, I need help?

I have a multiline edit box in a dialog and I am trying to get the
individual lines of
text from it and store them into a CStringArray for processing and for some
reason I am
having some trouble with it.
Can anyone help with some suggestions, any help will be greatly appreciated.


Sun, 25 Jul 2004 10:20:15 GMT  
 Getting the text from CEdit, I need help?
Associate a member variable of type Control [ CEdit ] to your Edit box. Let
us say 'm_MyEditBox'.

Now try the following...

    int nTotalLines = m_MyEditBox.GetLineCount();
    CString sLine;

    for (int nIndex =0; nIndex < nTotalLines; nIndex++)
    {
        // get the line.
        m_MyEditBox.GetLine( nIndex, sLine.GetBuffer(
m_MyEditBox.LineLength(nIndex) ) );
        sLine.ReleaseBuffer();

        // Add it to your String Array here.........
        // MyStringArray.Add( sLine ) ;
    }

Cheers
Check Abdoul
-----------------


Quote:
> I have a multiline edit box in a dialog and I am trying to get the
> individual lines of
> text from it and store them into a CStringArray for processing and for
some
> reason I am
> having some trouble with it.
> Can anyone help with some suggestions, any help will be greatly
appreciated.



Sun, 25 Jul 2004 10:33:40 GMT  
 Getting the text from CEdit, I need help?
I've got it.
Thank you very much.

Quote:
> Associate a member variable of type Control [ CEdit ] to your Edit box.
Let
> us say 'm_MyEditBox'.

> Now try the following...

>     int nTotalLines = m_MyEditBox.GetLineCount();
>     CString sLine;

>     for (int nIndex =0; nIndex < nTotalLines; nIndex++)
>     {
>         // get the line.
>         m_MyEditBox.GetLine( nIndex, sLine.GetBuffer(
> m_MyEditBox.LineLength(nIndex) ) );
>         sLine.ReleaseBuffer();

>         // Add it to your String Array here.........
>         // MyStringArray.Add( sLine ) ;
>     }

> Cheers
> Check Abdoul
> -----------------



> > I have a multiline edit box in a dialog and I am trying to get the
> > individual lines of
> > text from it and store them into a CStringArray for processing and for
> some
> > reason I am
> > having some trouble with it.
> > Can anyone help with some suggestions, any help will be greatly
> appreciated.



Sun, 25 Jul 2004 11:19:04 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. Getting the text from CEdit, I need help?

2. CEdit::CharFromPos failing for large text, need help

3. Need to Set text from Dialog CEdit to Active Window in MDI text app

4. Getting selected text from CEdit?

5. Getting text from external CEdit ...?

6. Need help on save texts format by Textout to a text file

7. CEdit control pasting text help...

8. Text erases itself in my multiline CEdit ! Help

9. Help with setting text in CEdit

10. CEdit help needed

11. Help, getting a character from a text file.

12. need help on CEdit command

 

 
Powered by phpBB® Forum Software