Le réseau pour les développeurs > Forums - Accueil > Visual C++ General > CRichEditView: Reading .txt and .rtf files
Poser une questionPoser une question
 

TraitéeCRichEditView: Reading .txt and .rtf files

  • mercredi 4 novembre 2009 17:11lesPaul456 Médailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateurMédailles de l'utilisateur
     

    Hello,

    About two days ago I started working on a simple text editor using the MFC Feature Pack.

    Using the wizard, I created an application that uses CRichEditView as the base class. So far I have the ribbon complete. The last thing I'm working on is opening and saving files.

    I'm actually a C# programmer, and I have only limited experience in C++. In C#, file operations are very simple, usually requiring only a few lines of code...

    So far I have not added any code to save or open files. It seems the wizard took care of saving the files for me, since I can save a .rtf or .txt file perfectly fine. However, when I attempt to open a file, a new tab opens (it's a MDI application with tabbed documents) it's blank with no text.

    ...So I'm hoping that someone can give me some advice on how to read a file using a CRichEditView.

    Also, I should note that I'm not sure where I should even put this code. To format the documents, I added the code to the CRichEditView's cpp file. Would it be the same or would I use the CRichEditDoc?

    Thanks!

Réponses

Toutes les réponses