This documentation is archived and is not being maintained.

mNotepad Sample: Demonstrates Managed Extensions for C++ and the .NET Framework Classes

Visual Studio .NET 2003

The mNotepad sample implements a simple text editor with a standard user interface. It demonstrates the use of the .NET Framework classes to write a user interface without the support of the resource editors used by standard MFC applications. The user interface implements only the minimal functionality of a text editor.

The focus of the sample is the mNotepad object (of type System.Windows.Forms). This object is implemented by a .NET Framework class that uses a Windows edit control to hold the entire text document in memory while the user edits the document's contents. The TextBox class significantly extends the functionality of the edit control by handling the Cut, Copy, Paste, Select All, and Undo commands found on the top-level Edit menu.

Building and Running the Sample

To build and run mNotepad using Visual Studio

  1. In the Visual Studio IDE, load the solution file notepad.sln.
  2. In Solution Explorer, right-click the notepad solution.
  3. On the shortcut menu, click Build.
  4. On the Debug menu, click Start.

Run the resulting application and try out the basic features of the text editor.


This sample demonstrates the following keywords:

CBitmap::LoadBitmap; TextBox::Undo; TextBox::Cut; TextBox::Copy; TextBox::Paste; TextBox::SelectAll; MessageBox::Show; OpenFileDialog::ShowDialog; SaveFileDialog::ShowDialog; StreamReader::ReadToEnd; StreamWriter::Write

See Also

Managed Extensions for C++ Samples