亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? apf.htm

?? Learning language of Visual C++6
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
<SCRIPT LANGUAGE="JavaScript">

<!--

function popUp(pPage) {
 var fullURL = document.location;
 var textURL = fullURL.toString();
 var URLlen = textURL.length;
 var lenMinusPage = textURL.lastIndexOf("/");
 lenMinusPage += 1;
 var fullPath = textURL.substring(0,lenMinusPage);
 popUpWin = window.open('','popWin','resizable=yes,scrollbars=no,width=525,height=394');
 figDoc= popUpWin.document;
 zhtm= '<HTML><HEAD><TITLE>' + pPage + '</TITLE>';
 zhtm += '<link rel="stylesheet" href="/includes/stylesheets/ebooks.css"></head>';
 zhtm += '<BODY bgcolor="#FFFFFF">';
 zhtm += '<IMG SRC="' + fullPath + pPage + '">';
 zhtm += '<P><B>' + pPage + '</B>';
 zhtm += '</BODY></HTML>';
 window.popUpWin.document.write(zhtm);
 window.popUpWin.document.close();
 // Johnny Jackson 4/28/98
 }

//-->
                                                                
</SCRIPT>
<link rel="stylesheet" href="/includes/stylesheets/ebooks.css">

	
	<TITLE>Special Edition Using Visual C++ 6 -- Appendix F -- Useful Classes</TITLE>
</HEAD>

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

<CENTER>
<H1><IMG SRC="../button/que.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM" BORDER="0"><BR>
Special Edition Using Visual C++ 6</H1>
</CENTER>
<CENTER>
<P><A HREF="../ape/ape.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"
ALIGN="BOTTOM" ALT="Previous 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>
<CENTER>
<H1>- F -</H1>
</CENTER>
<CENTER>
<H1>Useful Classes</H1>
</CENTER>

<UL>
	<LI><A HREF="#Heading1">The Array Classes</A>
	<UL>
		<LI><A HREF="#Heading2">Introducing the Array Application</A>
		<LI><A HREF="#Heading3">Declaring and Initializing the Array</A>
		<LI><A HREF="#Heading4">Adding Elements to the Array</A>
		<LI><A HREF="#Heading5">Reading Through the Array</A>
		<LI><A HREF="#Heading6">Removing Elements from the Array</A>
	</UL>
	<LI><A HREF="#Heading7">The List Classes</A>
	<UL>
		<LI><A HREF="#Heading8">Introducing the List Application</A>
		<LI><A HREF="#Heading9">Declaring and Initializing the List</A>
		<LI><A HREF="#Heading10">Adding a Node to the List</A>
		<LI><A HREF="#Heading11">Deleting a Node from the List</A>
		<LI><A HREF="#Heading12">Iterating Over the List</A>
		<LI><A HREF="#Heading13">Cleaning Up the List</A>
	</UL>
	<LI><A HREF="#Heading14">The Map Classes</A>
	<UL>
		<LI><A HREF="#Heading15">Introducing the Map Application</A>
		<LI><A HREF="#Heading16">Creating and Initializing the Map</A>
		<LI><A HREF="#Heading17">Retrieving a Value from the Map</A>
		<LI><A HREF="#Heading18">Iterating Over the Map</A>
	</UL>
	<LI><A HREF="#Heading19">Collection Class Templates</A>
	<LI><A HREF="#Heading20">The String Class</A>
	<LI><A HREF="#Heading21">The Time Classes</A>
	<UL>
		<LI><A HREF="#Heading22">Using a CTime Object</A>
		<LI><A HREF="#Heading23">Using a CTimeSpan Object</A>
	</UL>
</UL>

<P>
<HR SIZE="4">

<CENTER>
<H1></H1>
</CENTER>
<P>MFC includes a lot more than classes for programming the Windows graphical user
interface. It also features many utility classes for handling such things as lists,
arrays, times and dates, and mapped collections. By using these classes, you gain
extra power over data in your programs and simplify many operations involved in using
complex data structures such as lists.</P>
<P>For example, because MFC's array classes can change their size dynamically, you
are relieved of creating oversized arrays in an attempt to ensure that the arrays
are large enough for the application. In this way, you save memory. You don't have
to worry about resizing the arrays yourself, and you avoid many of the subtle bugs
and memory leaks that occur from mistakes in array-resizing code. The other collection
classes provide many other similar conveniences.</P>
<P>
<H2><A NAME="Heading1"></A>The Array Classes</H2>
<P>MFC's array classes enable you to create and manipulate one-dimensional array
objects that can hold virtually any type of data. These array objects work much like
the standard arrays that you're familiar with using in your programs, except that
MFC can enlarge or shrink an array object dynamically at runtime. This means that
you don't have to be concerned with dimensioning your array just right when it's
declared. Because MFC's arrays can grow dynamically, you can forget about the memory
waste that often occurs with conventional arrays, which must be dimensioned to hold
the maximum number of elements needed in the program, whether or not you actually
use every element.</P>
<P>The array classes include CByteArray, CDWordArray, CObArray, CPtrArray, CUIntArray,
CWordArray, and CStringArray. As you can tell from the classnames, each class is
designed to hold a specific type of data. For example, the CUIntArray, which is used
in this section's examples, is an array class that can hold unsigned integers. The
CPtrArray class, on the other hand, represents an array of pointers to void, and
the CObArray class represents an array of objects. The array classes are all nearly
identical, differing only in the type of data that they store. When you've learned
to use one of the array classes, you've learned to use them all. Table F.1 lists
the member functions of the array classes and their descriptions.</P>
<P>
<H4>Table F.1&#160;&#160;Member Functions of the Array Classes</H4>
<P>
<TABLE BORDER="1">
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT"><B>Function</B></TD>
		<TD ALIGN="LEFT"><B>Description</B></TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">Add()</TD>
		<TD ALIGN="LEFT">Appends a value to the end of the array, increasing the size of the array, as needed.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">ElementAt()</TD>
		<TD ALIGN="LEFT">Gets a reference to an array element's pointer.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">FreeExtra()</TD>
		<TD ALIGN="LEFT">Releases unused array memory.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">GetAt()</TD>
		<TD ALIGN="LEFT">Gets the value at the specified array index.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">GetSize()</TD>
		<TD ALIGN="LEFT">Gets the number of elements in the array.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">GetUpperBound()</TD>
		<TD ALIGN="LEFT">Gets the array's <I>upper bound,</I> which is the highest valid index at which a
			value can be stored.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">InsertAt()</TD>
		<TD ALIGN="LEFT">Inserts a value at the specified index, shifting existing elements upward, as necessary,
			to accommodate the insert.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">RemoveAll()</TD>
		<TD ALIGN="LEFT">Removes all the array's elements.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">RemoveAt()</TD>
		<TD ALIGN="LEFT">Removes the value at the specified index.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">SetAt()</TD>
		<TD ALIGN="LEFT">Places a value at the specified index. Because this function will not increase the
			array's size, the index must be currently valid.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">SetAtGrow()</TD>
		<TD ALIGN="LEFT">Places a value at the specified index, increasing the array's size, as needed.</TD>
	</TR>
	<TR ALIGN="LEFT" VALIGN="TOP">
		<TD ALIGN="LEFT">SetSize()</TD>
		<TD ALIGN="LEFT">Sets the array's initial size and the amount by which it grows when needed. By allocating
			more than one element's worth of space at a time, you save time but might waste memory.</TD>
	</TR>
</TABLE>



<BLOCKQUOTE>
	<P>
<HR>
<B>Array Templates</B></P>
	<P>Because the only difference between all these array classes is the type of data
	they hold, they seem like an obvious use for templates. In fact, they predate the
	implementation of templates in Visual C++. There is a vector template in the Standard
	Template Library, discussed in Chapter 26, &quot;Exceptions and Templates,&quot;
	which holds simple lists of any single data type. Many developers find the MFC array
	classes much easier to use than templates. There are also MFC collection templates,
	discussed later in this chapter. 
<HR>


</BLOCKQUOTE>

<H3><A NAME="Heading2"></A>Introducing the Array Application</H3>
<P>To illustrate how the array classes work, this chapter includes the Array application.
When you run the program, you see the window shown in Figure F.1. The window displays
the array's current contents. Because the application's array object (which is an
instance of CUIntArray) starts off with 10 elements, the values for these elements
(indexed as 0 through 9) are displayed onscreen. The application enables you to change,
add, or delete elements in the array and see the results.</P>
<P><A HREF="javascript:popUp('xfuvc01.gif')"><B>FIG. F.1</B></A><B> </B><I>The Array
application enables you to experiment with MFC's array classes.</I></P>
<P>You can add an element to the array in several ways. To see these choices, click
in the application's window. The dialog box shown in Figure F.2 appears. Type an
array index in the Index box and the new value in the Value box. Then select whether
you want to set, insert, or add the element. When you choose Set, the value of the
element you specify in the Index field is changed to the value in the Value field.
The Insert operation creates a new array element at the location specified by the
index, pushing succeeding elements forward. Finally, the Add operation tacks the
new element on the end of the array. In this case, the program ignores the Index
field of the dialog box.</P>
<P><A HREF="javascript:popUp('xfuvc02.gif')"><B>FIG. F.2</B></A><B> </B><I>The Add
to Array dialog box enables you to add elements to the array.</I></P>
<P>Suppose, for example, that you enter <B>3</B> in the dialog box's Index field
and <B>15</B> in the Value field, leaving the Set radio button selected. Figure F.3
shows the result: The program has placed the value 15 in element 3 of the array,
overwriting the previous value. Now type <B>2</B> in Index, <B>25</B> in Value, select
the Insert radio button, and click OK. Figure F.4 shows the result: The program stuffs
a new element in the array, shoving the other elements forward.</P>
<P><A HREF="javascript:popUp('xfuvc03.gif')"><B>FIG. F.3</B></A><B> </B><I>The value
15 has been placed in array element 3.</I></P>
<P>An interesting thing to try--something that really shows how dynamic MFC's arrays
are--is to set an array element beyond the end of the array. For example, given the
program's state shown in Figure F.4, if you type <B>20 </B>in Index and <B>45</B>
in Value and then choose the Set radio button, you get the results shown in Figure
F.5. Because there was no element 20, the array class created the new elements that
it needed to get to 20. You don't need to keep track of how many elements are in
the array. Try that with an old-fashioned array.</P>
<P><A HREF="javascript:popUp('xfuvc04.gif')"><B>FIG. F.4</B></A><B> </B><I>The screen
now shows the new array element, giving 11 elements in all.</I></P>
<P><A HREF="javascript:popUp('xfuvc05.gif')"><B>FIG. F.5</B></A><B> </B><I>The array
class has added the elements needed to set element 20.</I></P>
<P>Besides adding new elements to the array, you can also delete elements in one
of two ways. To do this, first right-click in the window. When you do, you see the
dialog box shown in Figure F.6. If you type an index in the Remove field and then
click OK, the program deletes the selected element from the array. This has the opposite
effect of the Insert command because the Remove command shortens the array, rather
than lengthen it. If you want, you can select the Remove All option in the dialog
box. Then the program deletes all elements from the array, leaving it empty.</P>
<P><A HREF="javascript:popUp('xfuvc06.gif')"><B>FIG. F.6</B></A><B> </B><I>The Remove
From Array dialog box enables you to delete elements from the array.</I></P>
<P>
<H3><A NAME="Heading3"></A>Declaring and Initializing the Array</H3>
<P>Now you'd probably like to see how all this array trickery works. It's really
pretty simple. First, the program declares the array object as a data member of the
view class, like this:</P>
<P>
<PRE>CUIntArray array;
</PRE>
<P>Then, in the view class's constructor, the program initializes the array to 10
elements:</P>
<P>
<PRE>array.SetSize(10, 5);
</PRE>
<P>The SetSize() function takes as parameters the number of elements to give the
array initially and the number of elements by which the array should grow whenever
it needs to. You don't need to call SetSize() to use the array class. If you don't,
MFC adds elements to the array one at a time, as needed, which can be slow. Unless
you're doing some heavy processing, though, you're not likely to notice any difference
in speed. If your application doesn't often add elements to its arrays and you are
concerned about memory consumption, don't use SetSize(). If your application repeatedly
adds elements and you have lots of memory available, using SetSize() to arrange for
many elements to be allocated at once will reduce the number of allocations performed,
giving you a faster application.</P>
<P>
<H3><A NAME="Heading4"></A>Adding Elements to the Array</H3>
<P>After setting the array size, the program waits for the user to click the left
or right mouse buttons in the window. When the user does, the program springs into
action, displaying the appropriate dialog box and processing the values entered in
the dialog box. Listing F.1 shows the Array application's OnLButtonDown() function,
which handles the left mouse button clicks.</P>


<BLOCKQUOTE>
	<P>
<HR>
<STRONG>TIP:</STRONG> Chapter 3, &quot;Messages and Commands,&quot; shows you how
	to catch mouse clicks and arrange for a message handler such as OnLButtonDown() to
	be called. 
<HR>


</BLOCKQUOTE>

<H4>Listing F.1&#160;&#160;CArrayView::OnLButtonDown()</H4>
<PRE>void CArrayView::OnLButtonDown(UINT nFlags, CPoint point) 

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产三级精品在线| 精品国内二区三区| 久久99精品久久久久| 亚洲一区在线观看视频| 亚洲日本护士毛茸茸| 欧美一级久久久久久久大片| 日本道色综合久久| 色综合久久中文综合久久牛| 成人97人人超碰人人99| 国产精品亚洲视频| 欧美aaaaa成人免费观看视频| 污片在线观看一区二区| 一区二区三区精品视频在线| 欧美国产视频在线| 国产日产亚洲精品系列| 国产偷国产偷精品高清尤物| 久久人人爽爽爽人久久久| 日韩欧美成人一区| 日韩一区二区三区精品视频| 欧美久久久一区| 91精品国产综合久久福利| 在线综合视频播放| 欧美一级视频精品观看| 91精品国产91久久久久久一区二区| 欧美日韩精品免费| 欧美精品在线一区二区| 91精品国产综合久久香蕉的特点| 欧美韩日一区二区三区| 中文字幕欧美日本乱码一线二线| 国产精品网站一区| 国产日本一区二区| 亚洲国产电影在线观看| 一区二区三区欧美视频| 日韩av在线播放中文字幕| 国产高清久久久| 色琪琪一区二区三区亚洲区| 欧美一区二区在线看| 国产视频一区在线观看| 一区二区三区国产精华| 精品一区二区三区影院在线午夜| 97se亚洲国产综合自在线不卡| 精品视频在线看| 久久久精品一品道一区| 亚洲综合一区二区三区| 九九精品一区二区| 一本在线高清不卡dvd| 欧美成人伊人久久综合网| 亚洲欧洲日本在线| 蜜桃精品视频在线| 91浏览器在线视频| 欧美mv日韩mv国产网站app| 亚洲色图视频网| 国产美女精品在线| 欧美吞精做爰啪啪高潮| 国产精品私房写真福利视频| 日韩av一区二区三区| 99久久精品国产导航| 精品久久99ma| 99久久99久久精品国产片果冻| 91.成人天堂一区| 亚洲人成7777| 国产精品 欧美精品| 欧美高清hd18日本| 亚洲色图一区二区| 国产69精品久久久久毛片 | 日韩精品一区二区三区四区视频| 亚洲欧洲日本在线| 国产成人综合视频| 8v天堂国产在线一区二区| 亚洲视频一二区| 国产+成+人+亚洲欧洲自线| 91精品免费在线观看| 亚洲一区二区不卡免费| 99久久国产综合色|国产精品| 精品国产乱码久久久久久1区2区 | 国产成人免费在线观看| 日韩午夜在线观看视频| 亚洲午夜精品网| 99久久精品国产一区| 久久久久久久精| 精品一二三四区| 91精品欧美一区二区三区综合在| 亚洲午夜免费电影| 99久久国产综合精品女不卡| 久久久一区二区三区| 肉肉av福利一精品导航| 91极品视觉盛宴| 一区二区三区在线观看欧美 | 国产精品网站在线播放| 国产九色精品成人porny| 日韩欧美的一区| 六月婷婷色综合| 日韩视频中午一区| 日本视频在线一区| 日韩欧美一区二区在线视频| 五月婷婷激情综合| 欧美区一区二区三区| 亚洲午夜精品在线| 欧美精品久久久久久久久老牛影院| 一区二区三区免费看视频| 色综合久久久网| 亚洲最大色网站| 欧美日韩在线精品一区二区三区激情| 亚洲综合偷拍欧美一区色| 色先锋久久av资源部| 一区二区三区四区av| 欧美日韩一区二区欧美激情| 亚洲不卡一区二区三区| 日韩欧美在线不卡| 国产高清在线观看免费不卡| 国产日韩欧美精品电影三级在线| 高清久久久久久| **网站欧美大片在线观看| av动漫一区二区| 亚洲综合精品自拍| 欧美日韩国产色站一区二区三区| 午夜视频一区二区三区| 91精品在线免费观看| 精品一区二区三区久久| 国产午夜精品福利| 色偷偷一区二区三区| 亚洲一区二区三区不卡国产欧美 | 国产精品久久久久影院老司 | 日韩欧美黄色影院| 国产一区二区三区在线观看免费视频| 国产亚洲一区二区三区| 成人精品一区二区三区四区 | 亚洲日本在线看| 欧美日韩久久不卡| 老司机免费视频一区二区三区| 精品不卡在线视频| 成人国产电影网| 亚洲成av人片一区二区三区| 欧美不卡一区二区三区| 成人永久aaa| 五月综合激情日本mⅴ| 国产婷婷色一区二区三区四区| 97久久久精品综合88久久| 日韩电影免费一区| 中文字幕欧美三区| 777午夜精品视频在线播放| 国产一区二区三区在线观看免费视频 | 国产精品视频第一区| 欧美日韩视频在线一区二区| 久久99久久99小草精品免视看| 国产精品精品国产色婷婷| 91精品在线观看入口| 99久久久久久| 老色鬼精品视频在线观看播放| 国产精品婷婷午夜在线观看| 5858s免费视频成人| 成人av在线播放网站| 亚洲成在人线在线播放| 国产欧美精品一区| 欧美日韩国产小视频在线观看| 国产高清不卡二三区| 亚洲成av人**亚洲成av**| 国产午夜精品美女毛片视频| 色呦呦国产精品| 国产福利电影一区二区三区| 亚洲国产精品视频| 中文av一区特黄| 欧美r级在线观看| 欧美亚洲国产一区在线观看网站 | 99国产精品久| 欧美日韩国产一二三| 精品久久久久久久久久久久久久久| 亚洲18女电影在线观看| 91福利区一区二区三区| 亚洲欧美日韩电影| 91视频观看视频| 亚洲老妇xxxxxx| 欧美在线不卡视频| 一区二区三区高清在线| 欧美性videosxxxxx| 亚洲国产美国国产综合一区二区| 91美女蜜桃在线| 国产精品福利一区二区| 国产精品久久久久天堂| 精品99一区二区| 欧美高清视频一二三区 | 国产一区二区剧情av在线| 亚洲国产aⅴ天堂久久| 国产精品私人自拍| 久久精品水蜜桃av综合天堂| 日韩一区二区三区在线视频| 欧美日韩另类国产亚洲欧美一级| 国产在线观看免费一区| 国产婷婷一区二区| 在线视频你懂得一区二区三区| 懂色av噜噜一区二区三区av| 精品一区精品二区高清| 美国十次了思思久久精品导航| 亚洲国产精品久久久久秋霞影院 | 久久99精品久久只有精品| 爽好多水快深点欧美视频| 亚洲va欧美va国产va天堂影院| 亚洲最大成人网4388xx| 亚洲伊人色欲综合网| 亚洲一级二级在线|