Visual C++ and MFC Programming 2nd Edition

(Martin Jones) #1

Chapter 2: Introduction to MFC Visual C++ and MFC Fundamentals


processing document and use it as if you were working from the application in which the
document was created. Here is a Microsoft Word document opened in Visual C++:

Figure 12: File Opening in Visual Studio..................................................................................


This means that C++ files are not the only files you are able to view in Visual C++.
Although you can open various types of document, this does not imply that any of them
would display easily. Some of them may have rules to follow. That is why the Open
dialog box of Visual C++ is equipped with the Open As combo box. For example, when
opening a file that has the .rc extension, which is a resource file, you have the option of
opening it automatically or as a text file and the result would be different depending on
the selection option.

Practical Learning: Opening Files



  1. To open a new file, on the main menu, click File -> Open...

  2. Locate the exercises that accompany this book and display the Exercise1 folder in
    the Look In combo box

  3. Make sure the Files of Type is set to C++ Files (.c;, cpp:, .cxx;, .tli;, .h;, .tlh;, .inl;,
    .rc) or All Files.
    Click Exercise1View.cpp and click Open

  4. To open another file, on the Standard toolbar, click the Open button

  5. Click Exercise1.rc

  6. Click the arrow of the Open As combo box and select Text

Free download pdf