⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 apa.htm

📁 Visual C++ 的学习资料 Visual C++ 的学习资料
💻 HTM
📖 第 1 页 / 共 2 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
	<META NAME="GENERATOR" Content="Symantec Visual Page Mac 1.1">
	<TITLE>Teach Yourself Visual C++&reg; 5 in 24 Hours -- Appendix A -- The Developer Studio IDE</TITLE>
</HEAD>

<BODY TEXT="#000000" BGCOLOR="#FFFFFF">

<H1 ALIGN="CENTER"><IMG SRC="../button/sams.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM"
BORDER="0"><BR>
<FONT COLOR="#000077">Teach Yourself Visual C++&reg; 5 in 24 Hours</FONT></H1>
<CENTER>
<P><A HREF="../ch24/ch24.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"
ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../apb/apb.htm"><IMG
SRC="../button/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"
BORDER="0"></A><A HREF="../index.htm"><IMG SRC="../button/contents.gif" WIDTH="128"
HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A> 
<HR>

</CENTER>
<H1 ALIGN="CENTER"><FONT COLOR="#000077">- Appendix A -<BR>
The Developer Studio IDE</FONT></H1>
<P>This appendix covers some basic information about the Developer Studio Integrated
Development Environment.
<H2><FONT COLOR="#000077"><B>What Is the Developer Studio Editor?</B></FONT></H2>
<P>Developer Studio includes a sophisticated editor as one of its tools. The editor
is integrated with the other parts of Developer Studio; files are edited in a Developer
Studio child window. You use the Developer Studio editor to edit C++ source files
that will be compiled into Windows programs. The editor supplied with Developer Studio
is similar to a word processor, but instead of fancy text-formatting features, it
has features that help make writing source code easy.
<H3><FONT COLOR="#000077"><B>Why Use the Developer Studio Editor?</B></FONT></H3>
<P>You can use almost any editor to write C++ source code, but there are several
reasons to consider using the editor integrated with Developer Studio. The editor
includes many features that are found in specialized programming editors.

<UL>
	<LI>Automatic syntax highlighting colors keywords, comments, and other source code
	in different colors.<BR>
	<BR>
	
	<LI>Automatic &quot;smart&quot; indenting helps line up your code into easy-to-read
	columns.<BR>
	<BR>
	
	<LI>Emulation for keystrokes used by other editors helps if you are familiar with
	editors such as Brief and Epsilon.<BR>
	<BR>
	
	<LI>Integrated keyword help enables you to get help on any keyword, MFC class, or
	Windows function just by pressing F1.<BR>
	<BR>
	
	<LI>Drag-and-drop editing enables you to easily move text by dragging it with the
	mouse.<BR>
	<BR>
	
	<LI>Integration with the compiler's error output helps you step through the list
	of errors reported by the compiler and positions the cursor at every error. This
	enables you to make corrections easily without leaving Developer Studio.
</UL>

<H3><FONT COLOR="#000077"><B>Using the Developer Studio Editor</B></FONT></H3>
<P>The easiest way to learn about the Developer Studio editor is to edit a file and
run through a few common actions, such as creating a new source file, saving and
loading files, and using a few keyboard commands.
<H4><FONT COLOR="#000077">Editing a New Source File</FONT></H4>
<P>To edit a new source file, click the New Text File icon on the toolbar. The New
Text File icon looks like a blank piece of paper with a yellow highlight in one corner.
You can also open a new source file using the menu by following these steps:

<DL>
	<DD>1. Select New from the File menu. This displays the New dialog box, which enables
	you to create a new text file, project, or other type of file.<BR>
	<BR>
	2. Select the Files tab. Several different types of files will be displayed. Select
	the C++ Source File icon in the list box.<BR>
	<BR>
	3. Click OK to close the New dialog box and open the new file for editing.
</DL>

<P>Each of the preceding methods creates an empty source file ready for editing.
Type the source code from Listing A.1 into the new file.
<H4><FONT COLOR="#000077">TYPE: Listing A.1. A minimal C++ program.</FONT></H4>
<PRE><FONT COLOR="#0066FF"><TT>// This is a comment</TT>
<TT>int main()</TT>
<TT>{</TT>
<TT>    return 0;</TT>
</FONT></PRE>
<P><TT>}</TT> The source code in Listing A.1 is a legal C++ program, although it
doesn't actually do anything. As you typed the source code into the editor, the colors
for some of the words should have changed. This is called syntax highlighting, and
it's one of the features of Developer Studio's editor.</P>
<P>The first line in Listing A.1 begins with <TT>//</TT>, which is used to mark the
beginning of a single-line comment in a C++ program. By default, comments are colored
green by the Developer Studio editor. In contrast, <TT>int</TT> and <TT>return</TT>
are colored blue to indicate that they are C++ keywords.</P>
<P>Another editor feature is called <I>smart indenting</I>. This feature automatically
arranges your text as you type, applying formatting rules to your text as each word
or line is entered into the editor. For example, enter the source code from Listing
A.2 into the text editor. Press Return at the end of each line, but do not add spaces
or tabs. As each line is typed, the editor rearranges the text into a standard format
for you.
<H4><FONT COLOR="#000077">TYPE: Listing A.2. A simple C++ class declaration.</FONT></H4>
<PRE><FONT COLOR="#0066FF"><TT>class CFoo</TT>
<TT>{</TT>
<TT>    int nFoo;</TT>
<TT>    int nBar;</TT>
<TT>public:</TT>
<TT>    CFoo();</TT>
</FONT></PRE>
<P><TT>}</TT> The source code provided in this book follows the same formatting convention
used by the Developer Studio editor. Although some coding styles might be more compact,
this style is very easy to read.
<H4><FONT COLOR="#000077">Saving a Source File</FONT></H4>
<P>To save the contents of the editor, click the Save icon on the toolbar. The Save
icon looks like a small floppy disk. You can also press Ctrl+S or select Save from
the File menu.</P>
<P>When updating an existing source file, you don't see a dialog box, and no further
action is needed on your part. The existing file is updated using the current contents
of the editor. If you save a new file, you see the Save As dialog box, and you must
choose a location and filename for the new source file. Save the contents of Listing
A.2 in the <TT>C:\</TT> directory using the name <TT>CFoo.cpp</TT>. After saving
the file, close <TT>CFoo.cpp</TT> by selecting Close from the File menu.</P>
<P>To save a file under a new name, select Save As from the File menu or press F12.
Enter the new path and filename using the Save As dialog box as described previously.
<H4><FONT COLOR="#000077">Opening an Existing Source File</FONT></H4>
<P>To open an existing source file, click the Open icon on the toolbar. The Open
icon looks like a folder that is partially open. You can also press Ctrl+O or select
Open from the File menu. Any of these methods brings up the File Open dialog box.</P>
<P>To open the <TT>CFoo.cpp</TT> file for editing, pop up the File Open dialog box
and navigate to the <TT>C:\</TT> directory. Select the <TT>CFoo.cpp</TT> file and
click the button labeled Open. The <TT>CFoo.cpp</TT> file is loaded into the editor.
<H4><FONT COLOR="#000077">Using Editor Commands</FONT></H4>
<P>As discussed in the first hour, a large set of editing commands is available from
the keyboard. Although most editor commands are also available from the menu or toolbar,
the following commands are frequently used from the keyboard:

<UL>
	<LI>Undo, which reverses the previous editor action, is performed by pressing Ctrl+Z
	on the keyboard. The number of undo steps that can be performed is configurable in
	the Options dialog box.<BR>
	<BR>
	

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -