CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Apr 1999
    Posts
    72

    Saving info in editbox control to txt file?

    How can I save what the user enters into an editbox to a text file (*.txt). Any suggestions?

    Thanks,
    Nathan Strandberg


  2. #2
    Join Date
    May 1999
    Posts
    42

    Re: Saving info in editbox control to txt file?

    Example, using MFC:

    // assume m_editBox is a CEdit;
    // error checking omitted, code not tested
    CString cText;
    m_editBox.GetWindowText( cText );
    CFile txtFile("EditBox.txt", CFile::modeCreate | CFile::modeWrite );
    txtFile.Write( cText.GetBuffer(1), cText.GetLength() );
    txtFile.Close();


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured