MFC General: How to make a simple text editor?
Q: How to make a simple text editor?
A: MFC AppWizard can help you to create in less than one minute a base text editor that implements:
- text editing;
- open and save from/to files;
- clipboard operations: cut, copy, and paste;
- undo last change;
- print and print preview.
Here are the steps to follow:
- Visual C++ 6.0
<br>
- choose "File/New/Project" menu item or press "Ctrl+N";
- in "New" dialog box, type the project name and choose "MFC AppWizard(exe)";
- push "OK" button; the "MFC Application Wizard" appears;
- in MFC AppWizard - Step 1: select "Single document" then push "Next" button;
- in MFC AppWizard - Step 2 to 5: push "Next" button;
- in MFC AppWizard - Step 6: change the base class of view from default "CView" to "CEditView";
- push "Finish" button; the "New Project Information" dialog appears;
- push "OK" button.
<br><br> - Visual C++ 200x
<br>
- choose "File/New/Project" menu item or press "Ctrl+Shift+N";
- in "New Project" dialog box, type the project name, then choose "Visual C++ Projects/MFC" and "MFC Application;
- push "OK" button; the "MFC Application Wizard" appears;
- select Application type "Single document";
- select from the left list "Generated Classes" item and change the base class for the view from default "CView" to "CEditView";
- push "Finish" button.
<br>
Further, if you want, you can enjoy improving it by adding new functions like changing font, search, replace, and so on.
<br><br>