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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? ch20.htm

?? VisualC21天自學(xué)教程.rar 英文經(jīng)典教程
?? HTM
?? 第 1 頁 / 共 4 頁
字號:
		</TD>		<TD ALIGN="LEFT">Disabled		</TD>		<TD ALIGN="LEFT">Checked		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Edit Box		</TD>		<TD ALIGN="LEFT">ID		</TD>		<TD ALIGN="LEFT">IDC_EMSG		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">			<P>		</TD>		<TD ALIGN="LEFT">Disabled		</TD>		<TD ALIGN="LEFT">Checked		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Command Button		</TD>		<TD ALIGN="LEFT">ID		</TD>		<TD ALIGN="LEFT">IDC_BSEND		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">			<P>		</TD>		<TD ALIGN="LEFT">Caption		</TD>		<TD ALIGN="LEFT">S&amp;end		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">			<P>		</TD>		<TD ALIGN="LEFT">Disabled		</TD>		<TD ALIGN="LEFT">Checked		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Static Text		</TD>		<TD ALIGN="LEFT">ID		</TD>		<TD ALIGN="LEFT">IDC_STATIC		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">			<P>		</TD>		<TD ALIGN="LEFT">Caption		</TD>		<TD ALIGN="LEFT">Sent:		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">List Box		</TD>		<TD ALIGN="LEFT">ID		</TD>		<TD ALIGN="LEFT">IDC_LSENT		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">			<P>		</TD>		<TD ALIGN="LEFT">Tab Stop		</TD>		<TD ALIGN="LEFT">Unchecked		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">			<P>		</TD>		<TD ALIGN="LEFT">Sort		</TD>		<TD ALIGN="LEFT">Unchecked		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">			<P>		</TD>		<TD ALIGN="LEFT">Selection		</TD>		<TD ALIGN="LEFT">None		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">Static Text		</TD>		<TD ALIGN="LEFT">ID		</TD>		<TD ALIGN="LEFT">IDC_STATIC		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">			<P>		</TD>		<TD ALIGN="LEFT">Caption		</TD>		<TD ALIGN="LEFT">Received:		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">List Box		</TD>		<TD ALIGN="LEFT">ID		</TD>		<TD ALIGN="LEFT">IDC_LRECVD		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">			<P>		</TD>		<TD ALIGN="LEFT">Tab Stop		</TD>		<TD ALIGN="LEFT">Unchecked		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">			<P>		</TD>		<TD ALIGN="LEFT">Sort		</TD>		<TD ALIGN="LEFT">Unchecked		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">			<P>		</TD>		<TD ALIGN="LEFT">Selection		</TD>		<TD ALIGN="LEFT">None		</TD>	</TR></TABLE></P><P>Once you have the dialog designed, open the Class Wizard to attach variables tothe controls on the dialog, as specified in Table 20.3.</P><P><H4>TABLE 20.3. CONTROL VARIABLES.</H4><P><TABLE BORDER="1">	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT"><I>Object</I></TD>		<TD ALIGN="LEFT"><I>Name</I></TD>		<TD ALIGN="LEFT"><I>Category</I></TD>		<TD ALIGN="LEFT"><I>Type</I></TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_BCONNECT		</TD>		<TD ALIGN="LEFT">m_ctlConnect		</TD>		<TD ALIGN="LEFT">Control		</TD>		<TD ALIGN="LEFT">CButton		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_EMSG		</TD>		<TD ALIGN="LEFT">m_strMessage		</TD>		<TD ALIGN="LEFT">Value		</TD>		<TD ALIGN="LEFT">CString		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_ESERVNAME		</TD>		<TD ALIGN="LEFT">m_strName		</TD>		<TD ALIGN="LEFT">Value		</TD>		<TD ALIGN="LEFT">CString		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_ESERVPORT		</TD>		<TD ALIGN="LEFT">m_iPort		</TD>		<TD ALIGN="LEFT">Value		</TD>		<TD ALIGN="LEFT">int		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_LRECVD		</TD>		<TD ALIGN="LEFT">m_ctlRecvd		</TD>		<TD ALIGN="LEFT">Control		</TD>		<TD ALIGN="LEFT">CListBox		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_LSENT		</TD>		<TD ALIGN="LEFT">m_ctlSent		</TD>		<TD ALIGN="LEFT">Control		</TD>		<TD ALIGN="LEFT">CListBox		</TD>	</TR>	<TR ALIGN="LEFT" VALIGN="TOP">		<TD ALIGN="LEFT">IDC_RCLIENT		</TD>		<TD ALIGN="LEFT">m_iType		</TD>		<TD ALIGN="LEFT">Value		</TD>		<TD ALIGN="LEFT">int		</TD>	</TR></TABLE></P><P>So that you can reuse the Connect button to place the server application intolisten mode, you'll add a function to the clicked event message for both radio buttons,changing the text on the command button depending on which of the two is currentlyselected. To add this functionality to your application, add a function to the BN_CLICKEDevent message for the IDC_RCLIENT control ID, naming the function OnRType. Add thesame function to the BN_CLICKED event message for the IDC_RSERVER control ID. Editthis function, adding the code in Listing 20.1.</P><P><H4>LISTING 20.1. THE CSockDlg OnRType FUNCTION.</H4><PRE> 1: void CSockDlg::OnRType() 2: { 3:     // TODO: Add your control notification handler code here 4:     // Sync the controls with the variables 5:     UpdateData(TRUE); 6:     // Which mode are we in? 7:     if (m_iType == 0)    // Set the appropriate text on the button 8:         m_ctlConnect.SetWindowText(&quot;C&amp;onnect&quot;); 9:     else10:         m_ctlConnect.SetWindowText(&quot;&amp;Listen&quot;);11: }</PRE><P>Now, if you compile and run your application, you should be able to select oneand then the other of these two radio buttons, and the text on the command buttonshould change to reflect the part the application will play, as in Figure 20.5.</P><P><A HREF="javascript:popUp('20fig05.gif')"><B>FIGURE 20.5.</B></A><B> </B><I>Changingthe button text.</I></P><P><I></I><H3><A NAME="Heading11"></A>Inheriting from the CAsyncSocket Class</H3><P>So that you will be able to capture and respond to the socket events, you'll createyour own descendent class from CAsyncSocket. This class will need its own versionsof the event functions, as well as a means of passing this event to the dialog thatthe object will be a member of. So that you can pass each of these events to thedialog-class level, you'll add a pointer to the parent dialog class as a member variableof your socket class. You'll use this pointer to call event functions for each ofthe socket events that are member functions of the dialog, after checking to makesure that no errors have occurred (of course).</P><P>To create this class in your application, select Insert | New Class from the menu.In the New Class dialog, leave the class type with the default value of MFC Class.Enter a name for your class, such as CMySocket, and select CAsyncSocket from thelist of available base classes. This is all that you can specify on the New Classdialog, so click the OK button to add this new class to your application.</P><P>Once you have created the socket class, add a member variable to the class toserve as a pointer to the parent dialog window. Specify the variable type as CDialog*,the variable name as m_pWnd, and the access as private. You also need to add a methodto the class to set the pointer, so add a member function to your new socket class.Specify the function type as void, the declaration as SetParent(CDialog* pWnd), andthe access as public. Edit this new function, setting the pointer passed as a parameterto the member variable pointer, as in Listing 20.2.</P><P><H4>LISTING 20.2. THE CMySocket SetParent FUNCTION.</H4><PRE> 1: void CMySocket::SetParent(CDialog *pWnd) 2: { 3:     // Set the member pointer 4:     m_pWnd = pWnd; 5: }</PRE><P>The only other thing that you need to do to your socket class is add the eventfunctions, which you'll use to call similarly named functions on the dialog class.To add a function for the OnAccept event function, add a member function to yoursocket class. Specify the function type as void, the function declaration as OnAccept(intnErrorCode), and the access as protected and check the virtual check box. Edit thisfunction, adding the code in Listing 20.3.</P><P><H4>LISTING 20.3. The CMySocket OnAccept FUNCTION.</H4><PRE> 1: void CMySocket::OnAccept(int nErrorCode) 2: { 3:     // Were there any errors? 4:     if (nErrorCode == 0) 5:         // No, call the dialog's OnAccept function 6:         ((CSockDlg*)m_pWnd)-&gt;OnAccept(); 7: }</PRE><P>Add similar functions to your socket class for the OnConnect, OnClose, OnReceive,and OnSend functions, calling same-named functions in the dialog class, which you'lladd later. After you've added all these functions, you'll need to include the headerfile for your application dialog in your socket class, as in line 7 of Listing 20.4.</P><P><H4>LISTING 20.4. THE CMySocket INCLUDES.</H4><PRE>1: // MySocket.cpp: implementation file2: //3:4: #include &quot;stdafx.h&quot;5: #include &quot;Sock.h&quot;6: #include &quot;MySocket.h&quot;7: #include &quot;SockDlg.h&quot;</PRE><P>Once you've added all the necessary event functions to your socket class, you'lladd a variable of your socket class to the dialog class. For the server functionality,you'll need two variables in the dialog class, one to listen for connection requestsand the other to be connected to the other application. Because you will need twosocket objects, add two member variables to the dialog class (CSockDlg). Specifythe type of both variables as your socket class (CMySocket) and the access for bothas private. Name one variable m_sListenSocket, to be used for listening for connectionrequests, and the other m_sConnectSocket, to be used for sending messages back andforth.</P><P>Once you've added the socket variables, you'll add the initialization code forall the variables. As a default, set the application type to client, the server nameas loopback, and the port to 4000. Along with these variables, you'll set the parentdialog pointers in your two socket objects so that they point to the dialog class.You can do this by adding the code in Listing 20.5 to the OnInitDialog function inthe dialog class.</P><BLOCKQUOTE>	<P><HR><STRONG>NOTE:</STRONG> The computer name loopback is a special name used in the TCP/IP network	protocol to indicate the computer you are working on. It's an internal computer name	that is resolved to the network address 127.0.0.1. This is a computer name and address	that is commonly used by applications that need to connect to other applications	running on the same computer.<HR></BLOCKQUOTE><H4>LISTING 20.5. THE CSockDlg OnInitDialog FUNCTION.</H4><PRE> 1: BOOL CSockDlg::OnInitDialog() 2: { 3:     CDialog::OnInitDialog(); 4: 5:     // Add &quot;About...&quot; menu item to system menu. 6:...26:     SetIcon(m_hIcon, FALSE);        // Set small icon27:28:     // TODO: Add extra initialization here29:     // Initialize the control variables30:     m_iType = 0;31:     m_strName = &quot;loopback&quot;;32:     m_iPort = 4000;33:     // Update the controls34:     UpdateData(FALSE);35:     // Set the socket dialog pointers36:     m_sConnectSocket.SetParent(this);37:     m_sListenSocket.SetParent(this);38:39:     return TRUE;  // return TRUE  unless you set the focus to a 	         &Acirc;control40: }</PRE><H3><A NAME="Heading12"></A>Connecting the Application</H3><P>When the user clicks the Connect button, you'll disable all the top controls onthe dialog. At this point, you don't want the user to think that she is able to changethe settings of the computer that she's connecting to or change how the applicationis listening. You'll call the Create function on the appropriate socket variable,depending on whether the application is running as the client or server. Finally,you'll call either the Connect or Listen function to initiate the application's sideof the connection. To add this functionality to your application, open the ClassWizard and add a function to the BN_CLICKED event message for the Connect button(ID IDC_BCONNECT). Edit this function, adding the code in Listing 20.6.</P><P><H4>LISTING 20.6. The CSockDlg OnBconnect FUNCTION.</H4><PRE> 1: void CSockDlg::OnBconnect() 2: { 3:     // TODO: Add your control notification handler code here 4:     // Sync the variables with the controls 5:     UpdateData(TRUE); 6:     // Disable the connection and type controls 7:     GetDlgItem(IDC_BCONNECT)-&gt;EnableWindow(FALSE); 8:     GetDlgItem(IDC_ESERVNAME)-&gt;EnableWindow(FALSE); 9:     GetDlgItem(IDC_ESERVPORT)-&gt;EnableWindow(FALSE);10:     GetDlgItem(IDC_STATICNAME)-&gt;EnableWindow(FALSE);11:     GetDlgItem(IDC_STATICPORT)-&gt;EnableWindow(FALSE);12:     GetDlgItem(IDC_RCLIENT)-&gt;EnableWindow(FALSE);13:     GetDlgItem(IDC_RSERVER)-&gt;EnableWindow(FALSE);14:     GetDlgItem(IDC_STATICTYPE)-&gt;EnableWindow(FALSE);15:     // Are we running as client or server?16:     if (m_iType == 0)17:     {18:         // Client, create a default socket19:         m_sConnectSocket.Create();20:         // Open the connection to the server21:         m_sConnectSocket.Connect(m_strName, m_iPort);22:     }23:     else24:     {

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产欧美一区二区精品性| 韩国女主播成人在线| 日韩一区中文字幕| 久久久久高清精品| 国产欧美精品日韩区二区麻豆天美| 日韩精品一区二区三区蜜臀| 欧美一区二区精品| 欧美一区二区啪啪| 日韩西西人体444www| 日韩免费高清视频| 欧美mv日韩mv国产| 国产喂奶挤奶一区二区三区 | 日韩理论片在线| 国产精品久久一级| 亚洲精品伦理在线| 亚洲影院久久精品| 日韩av中文字幕一区二区三区 | 99精品视频一区二区| 91麻豆福利精品推荐| 欧洲精品在线观看| 欧美喷潮久久久xxxxx| 日韩一区二区视频| 欧美精品一区二区三区四区| 国产偷国产偷亚洲高清人白洁| 日本一区二区综合亚洲| 亚洲免费观看视频| 舔着乳尖日韩一区| 国产在线精品一区二区不卡了| 国产精品 欧美精品| 成人av电影免费在线播放| 色综合久久88色综合天天6| 91黄视频在线| 欧美电影精品一区二区| 久久久www成人免费无遮挡大片| 中文av一区二区| 亚洲高清免费视频| 韩国女主播一区二区三区| 99久免费精品视频在线观看 | 欧美国产一区二区在线观看| 亚洲免费资源在线播放| 日本欧美大码aⅴ在线播放| 国产一区在线精品| 色老头久久综合| 欧美电影免费观看高清完整版 | 美腿丝袜亚洲一区| 国产99一区视频免费| 色嗨嗨av一区二区三区| 精品国内片67194| 亚洲同性同志一二三专区| 日韩不卡一二三区| 成人免费毛片app| 91精品国产品国语在线不卡| 国产欧美精品国产国产专区| 午夜精品一区二区三区电影天堂| 国产精品一区二区在线观看网站| 91在线观看下载| 欧美一级在线视频| 亚洲三级理论片| 精品伊人久久久久7777人| 91免费在线视频观看| 日韩欧美成人一区| 一区二区三区四区乱视频| 国产乱国产乱300精品| 欧美日韩国产一二三| 国产欧美一区二区精品久导航 | 午夜精品一区二区三区电影天堂| 国产精品一卡二卡在线观看| 欧美日韩国产高清一区二区三区 | 日韩精品电影在线观看| 97se亚洲国产综合在线| 精品国产亚洲在线| 亚洲国产综合人成综合网站| 粉嫩av一区二区三区粉嫩| 日韩一区二区免费电影| 亚洲最新在线观看| 丁香五精品蜜臀久久久久99网站| 欧美一区二区三区爱爱| 亚洲无人区一区| 91欧美激情一区二区三区成人| 2021久久国产精品不只是精品| 婷婷亚洲久悠悠色悠在线播放 | 精品久久久久一区| 亚洲国产成人91porn| av成人免费在线观看| 国产欧美日韩精品a在线观看| 蜜桃在线一区二区三区| 欧美日韩日日摸| 亚洲激情六月丁香| gogogo免费视频观看亚洲一| 国产视频一区二区在线| 国精产品一区一区三区mba视频| 欧美色图在线观看| 久久夜色精品一区| 亚洲激情在线播放| 91网站视频在线观看| 久久亚洲综合色一区二区三区| 亚洲va欧美va国产va天堂影院| 成人一区二区三区中文字幕| 2021国产精品久久精品| 日韩电影在线观看一区| 色吧成人激情小说| 国产精品免费观看视频| 国产剧情一区在线| 欧美一区二区三区在| 亚洲亚洲人成综合网络| 色综合久久中文综合久久牛| 国产精品全国免费观看高清 | 久久精品国产亚洲aⅴ| 1024国产精品| 精品一区二区三区免费观看| 欧美精品1区2区| 亚洲国产成人va在线观看天堂| 91热门视频在线观看| 亚洲国产精品av| 丰满亚洲少妇av| 中文字幕精品三区| 国产成人福利片| 久久先锋影音av鲁色资源| 婷婷综合另类小说色区| 日韩一级二级三级| 日日夜夜免费精品| 欧美伦理电影网| 视频在线观看国产精品| 欧美高清www午色夜在线视频| 一区二区三区四区在线播放 | 色偷偷88欧美精品久久久 | 久久久精品免费网站| 丰满放荡岳乱妇91ww| 国产精品色哟哟| 99精品国产一区二区三区不卡| 中文字幕一区二区视频| av一区二区三区四区| 一色屋精品亚洲香蕉网站| 欧美色网一区二区| 日本伊人精品一区二区三区观看方式| 4438亚洲最大| 激情综合色播五月| 中文乱码免费一区二区| 成人av在线网| 亚洲国产精品久久不卡毛片| 91精品国模一区二区三区| 九一久久久久久| 国产日韩一级二级三级| www.欧美色图| 亚洲午夜精品一区二区三区他趣| 91麻豆精品国产91久久久久| 六月丁香婷婷久久| 亚洲国产高清在线观看视频| 色香蕉成人二区免费| 婷婷丁香久久五月婷婷| 精品久久久三级丝袜| 成人自拍视频在线| 亚洲黄色免费网站| 欧美成人aa大片| 风间由美中文字幕在线看视频国产欧美| 精品国内二区三区| 色吧成人激情小说| 免费成人深夜小野草| 中文字幕精品三区| 欧美日韩视频一区二区| 国产一区二区剧情av在线| 久久九九国产精品| 在线亚洲+欧美+日本专区| 蜜桃久久精品一区二区| 国产午夜精品一区二区三区视频| 91香蕉视频黄| 婷婷一区二区三区| ...xxx性欧美| 欧美一区二区在线不卡| 国产精品888| 五月天一区二区三区| 久久久久88色偷偷免费| 欧美肥大bbwbbw高潮| 成人免费视频一区| 亚洲成年人网站在线观看| 亚洲精品一区二区三区香蕉 | 欧美日韩国产综合一区二区| 国产乱码字幕精品高清av| 一区二区三国产精华液| 欧美精品一区男女天堂| 91国内精品野花午夜精品| 老汉av免费一区二区三区| 亚洲午夜国产一区99re久久| 国产日韩亚洲欧美综合| 777欧美精品| 91在线精品秘密一区二区| 久久精品国产一区二区三| 日韩一区精品视频| 亚洲人被黑人高潮完整版| 久久久综合九色合综国产精品| 欧洲精品一区二区三区在线观看| 麻豆精品视频在线| 视频一区二区三区中文字幕| 国产精品久久久久毛片软件| 日韩欧美国产成人一区二区| 欧美日韩黄视频| 色婷婷久久久亚洲一区二区三区| 99精品国产99久久久久久白柏 | 精品中文字幕一区二区| 香蕉乱码成人久久天堂爱免费|