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

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

?? ch24.htm

?? 一天之內學會VC#. 主要介紹VC#的各種應用和示例
?? HTM
?? 第 1 頁 / 共 3 頁
字號:
<!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 -- Hour 24 -- Creating ActiveX Controls</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="../ch23/ch23.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../apa/apa.htm"><IMGSRC="../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">- Hour 24 -<BR>Creating ActiveX Controls</FONT></H1><P>As discussed in Hour 20, &quot;Using ActiveX Controls,&quot; ActiveX controlsare components that can be used to easily add new functionality to your application.In this hour, you will learn about<UL>	<LI>Some of the internal plumbing that is required for an ActiveX control<BR>	<BR>		<LI>The support provided by MFC for ActiveX control development<BR>	<BR>		<LI>How to test ActiveX controls using tools supplied with Visual C++</UL><P>To help demonstrate these topics, you also will create and test an ActiveX controlthat you can use in your own projects.<H2><FONT COLOR="#000077"><B>What Is an ActiveX Control?</B></FONT></H2><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>The <I>Component Object Model</I>,or <I>COM</I>, is a specification that defines how software components should cooperatewith each other. ActiveX technologies are all built on top of the COM specification.</P><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>In COM, an <I>interface</I>is a group of related functions that are implemented together. All interfaces arenamed beginning with <TT>I</TT>, such as <TT>IDataObject</TT>.</P><P>At a minimum, an ActiveX control must be a COM object. This means that an ActiveXcontrol must support <TT>IUnknown</TT>, the interface supported by all COM objects.This allows for a great deal of latitude when deciding how a control is to be implemented;previously, the OLE custom control architecture required support of at least 14 interfaces.<BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>Just a Minute:</B></FONT><B> </B>Support for the	<TT>IUnknown</TT> interface is provided automatically when you use MFC and ControlWizard	to build your control. <HR></BLOCKQUOTE><P>Reducing the number of required interfaces allows ActiveX controls to be muchsmaller than the older OLE controls. It also makes it feasible to use ActiveX controlsto implement functionality where the size of the control is an important factor.Web pages can be more intelligent when a control is downloaded and activated to yourbrowser. For example, Microsoft's Internet Explorer has support for downloading ActiveXcontrols from a Web page. Although this opens a lot of exciting functionality, thesize of the control to be downloaded must be kept as small as possible.<H2><FONT COLOR="#000077"><B>ActiveX Control Properties, Events, and Methods</B></FONT></H2><P>Interaction with an ActiveX component takes place via properties, events, andmethods.<UL>	<LI>A <I>property</I> is an attribute associated with the control.<BR>	<BR>		<LI>An <I>event</I> is a notification message passed to the container by the control.<BR>	<BR>		<LI>A <I>method</I> is an exposed function that can be applied to the control via	<TT>IDispatch</TT>.</UL><P>You'll learn about each of these interaction methods in the next few sections.<H3><FONT COLOR="#000077"><B>Properties</B></FONT></H3><P>Properties are exposed by ActiveX controls, as well as by the client where thecontrol is located. There are four basic types of properties:<UL>	<LI><I>Ambient</I> <I>properties</I> are provided to the control by the container.	The control uses these properties in order to &quot;fit in&quot; properly. Commonly	used ambient properties include the container's background color, default font, and	foreground color.<BR>	<BR>		<LI><I>Extended</I> <I>properties</I> are implemented by the container but appear	to be generated by the control. For example, the tab order of various controls in	a container is an extended property.<BR>	<BR>		<LI><I>Stock</I> <I>properties</I> are control properties implemented by the ActiveX	control development kit. Examples of stock properties are the control font, the caption	text, and the foreground and background colors.<BR>	<BR>		<LI><I>Custom</I> <I>properties</I> are control properties that you implement.</UL><H3><FONT COLOR="#000077"><B>Events</B></FONT></H3><P>An event is used to send a notification message to the control's container. Typically,events are used to notify the container when mouse clicks or other events take place.There are two basic types of events:<UL>	<LI><I>Stock events</I> are implemented by the ActiveX control development kit and	are invoked just like a function call, such as <TT>FireError</TT>.<BR>	<BR>		<LI><I>Custom events</I> are implemented by you, although the MFC class library and	ClassWizard handle much of the work for you.</UL><H3><FONT COLOR="#000077"><B>Methods</B></FONT></H3><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B><I>OLE Automation</I>, nowoften referred to as just <I>Automation,</I> is a way of enabling a COM object tobe controlled by another party. Automation is provided through the <TT>IDispatch</TT>interface.</P><P>Automation was originally developed so that interpreted languages such as VisualBasic could control COM objects. Now most ActiveX controls use Automation to allowall sorts of programs--even those built using scripting languages such as JScriptand VBScript--access to the methods of ActiveX controls.<H2><FONT COLOR="#000077"><B>An ActiveX Control Example</B></FONT></H2><P><FONT COLOR="#000077"><B>New Term:</B></FONT><B> </B>S<I>ubclassing</I> is a methodof borrowing functionality from an existing window or control. By subclassing anexisting window or control, you can concentrate on adding only the new features offeredby your control. The control from which the functionality is borrowed is known asthe <I>superclass</I>.</P><P>As an example of creating an ActiveX control, you will now create an ActiveX controlnamed OleEdit that subclasses the existing Windows edit control. The OleEdit controlis similar to the basic Windows edit control, except that it exposes properties thatallow it to accept only numbers, letters, or a combination of both.</P><P>The control works by performing extra processing when the <TT>WM_CHAR</TT> messageis received by the control. Windows sends <TT>WM_CHAR</TT> to notify the edit controlthat the user has pressed a key on the keyboard. Ordinarily, the edit control wouldsimply add the new character to the edit control. When the <TT>WM_CHAR</TT> messageis received by the OleEdit control, it is processed as shown in Figure 24.1.</P><P><A NAME="01"></A><A HREF="01.htm"><B>Figure 24.1.</B></A> <BR><I>Handling <TT>WM_CHAR</TT> in OleEdit.</I></P><P>The property flags <TT>m_fTextAllowed</TT> and <TT>m_fNumbersAllowed</TT> areexposed as properties that can be changed by the OleEdit control's container.<H3><FONT COLOR="#000077"><B>Creating the Project</B></FONT></H3><P>To begin creating the OleEdit control, use the ControlWizard. Using ControlWizardto build a control is very much like using AppWizard to build applications. To startControlWizard and create the OleEdit control, follow these steps:<DL>	<DD>1. Select New from the File menu. The New dialog box is displayed.<BR>	<BR>	2. Select the Projects tab. A list of project types is displayed.<BR>	<BR>	3. To create an ActiveX control, select MFC ActiveX ControlWizard as the project	type.<BR>	<BR>	4. Specify OleEdit as the project name; a default location for your project will	automatically be provided for the location.<BR>	<BR>	5. Make sure the Create New Workspace radio button is selected, and click OK to create	the project.<BR>	<BR>	6. The initial page from the ControlWizard is shown in Figure 24.2. This page enables	you to specify the basic characteristics of the project, such as the number of controls	handled by this server, whether help files should be generated, and so on. Accept	all the default options presented on this page by clicking the Next button.</DL><P><A NAME="02"></A><A HREF="02.htm"><B>Figure 24.2.</B></A> <I><BR>The first page of the ActiveX ControlWizard.</I><DL>	<DD>7. The second ControlWizard page is shown in Figure 24.3. This page lets you	change the names associated with the control and its OLE interfaces, as well as define	properties for the control. There is also a drop-down list that allows a base class	to be specified for the control. Select Edit from the drop-down list to make the	OleEdit control a subclass of the standard edit control.</DL><P><A NAME="03"></A><A HREF="03.htm"><B>Figure 24.3.</B></A> <I><BR>The second page of the ActiveX ControlWizard.</I><DL>	<DD>8. Click the Finish button. As with other ControlWizard projects, a list of the	files to be created is displayed. Click OK, and the skeleton project is created.</DL><H3><FONT COLOR="#000077"><B>MFC Support for ActiveX Controls</B></FONT></H3><P>A set of MFC classes is used as a framework for all ActiveX controls built usingControlWizard. ClassWizard creates three classes that are specific to your project,using these three classes as base classes:<UL>	<LI><TT>COleControlModule</TT> is the class that manages the ActiveX control module.	This class plays a role similar to the <TT>CWinApp</TT> class used in applications	built using AppWizard. For the OleEdit project, the derived class is named <TT>COleEditApp</TT>.<BR>	<BR>		<LI><TT>COleControl</TT> is the base class that represents the actual control window.	This class is derived from <TT>CWnd</TT> and includes extra ActiveX functionality	for communicating with containers. For the OleEdit project, the derived class is	named <TT>CTestCtrl</TT>.<BR>	<BR>		<LI><TT>COlePropertyPage</TT> is the base class used to manage the property page	for the control. For the OleEdit project, the derived class is named <TT>CTestPropPage</TT>.</UL><H3><FONT COLOR="#000077"><B>Drawing the Control</B></FONT></H3><P>All visible OLE controls must be capable of drawing themselves. Even controlsthat aren't visible when active should draw something as an aid during program development.The OleEdit control is visible at runtime, and it should appear to be a standardedit control.<BLOCKQUOTE>	<P><HR><B> </B><FONT COLOR="#000077"><B>CAUTION:</B></FONT><B> </B>You might think that	because OleEdit is subclassed from the standard edit control, it can draw itself.	Unfortunately, very few controls actually draw themselves properly; the edit control	is not one that handles drawing properly. For most controls, you must be prepared	to handle the drawing yourself. <HR></BLOCKQUOTE><P>When an ActiveX control project is initially created, the control's <TT>OnDraw</TT>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
青青青伊人色综合久久| 亚洲精品国产精华液| 日韩成人免费电影| 91豆麻精品91久久久久久| 中文字幕在线不卡视频| 精品制服美女久久| 欧美精品亚洲一区二区在线播放| 久久久国产精华| 久久精品国产第一区二区三区 | 精品国产乱码久久久久久图片 | 亚洲特黄一级片| 国产精品123| 91精品国产综合久久福利软件| 午夜激情一区二区三区| 91色视频在线| 国产精品嫩草影院com| 成人免费视频caoporn| 国产精品青草久久| 久久国产婷婷国产香蕉| 久久久精品综合| 91原创在线视频| 亚洲图片有声小说| 日韩一区二区免费电影| 国产在线精品免费av| 国产精品网站一区| 在线观看视频91| 美国十次综合导航| 日本一区二区三区电影| 欧美日韩一级黄| 丝袜亚洲另类丝袜在线| 日本一区二区视频在线观看| 在线视频一区二区免费| 丝袜美腿亚洲色图| 国产精品美女久久久久高潮| 色欧美片视频在线观看在线视频| 天天影视网天天综合色在线播放| 中文字幕欧美国产| 欧美久久久久久久久| 成人网在线播放| 日本亚洲最大的色成网站www| 国产精品久久久久久久久久免费看 | 中文字幕欧美国产| 欧美色视频一区| 成人毛片视频在线观看| 亚洲免费av高清| 日韩欧美一区二区视频| 91极品视觉盛宴| 精品一区二区精品| 亚洲国产一区视频| 亚洲黄色录像片| 国产亚洲欧美一级| 欧美成人激情免费网| 欧美美女喷水视频| 在线视频综合导航| 92国产精品观看| 91啪在线观看| 91黄色免费观看| 亚洲国产乱码最新视频 | 欧美一个色资源| 91性感美女视频| 91亚洲精品乱码久久久久久蜜桃| 国产精品456露脸| 国产成人av福利| 99久久精品国产观看| 日本韩国一区二区三区视频| 一本大道综合伊人精品热热 | 日韩午夜激情av| 久久久蜜桃精品| 亚洲精品国产精华液| 亚洲成人午夜影院| 国产乱妇无码大片在线观看| 国产成人精品免费看| 不卡的电影网站| 国产精品1区2区| 久久国产欧美日韩精品| 北条麻妃国产九九精品视频| 国产精品一区二区91| 91啪九色porn原创视频在线观看| 日本高清无吗v一区| 亚洲精品在线三区| 一区二区三区中文字幕在线观看| 麻豆精品久久精品色综合| 成人免费高清视频| 日韩美女一区二区三区四区| 国产精品麻豆网站| 日韩免费福利电影在线观看| 欧美精品 日韩| 亚洲欧美综合另类在线卡通| 色婷婷综合视频在线观看| 制服丝袜激情欧洲亚洲| 久久久久久久久99精品| 久久99最新地址| 国产精品丝袜一区| 欧美中文字幕不卡| 免费看欧美美女黄的网站| 亚洲欧美综合色| 欧美日韩在线电影| 国产成人午夜高潮毛片| 亚洲国产视频一区二区| 精品日韩成人av| 在线观看日韩国产| 国产在线视频一区二区| 亚洲国产一区视频| 国产精品久久久久国产精品日日| 欧美系列在线观看| 亚洲国产精品二十页| 激情六月婷婷久久| 久久蜜桃av一区精品变态类天堂| 国产一区二区三区黄视频| 精品国产99国产精品| 成人午夜视频网站| 亚洲一区在线观看免费观看电影高清 | 成人黄色一级视频| 亚洲激情图片qvod| 欧美www视频| 成人av电影免费在线播放| 亚洲伊人伊色伊影伊综合网| 欧美军同video69gay| 美脚の诱脚舐め脚责91| 国产精品久久综合| 欧美电影在哪看比较好| 国产成人精品免费视频网站| 亚洲最大的成人av| 精品国产成人系列| 91精品办公室少妇高潮对白| 日本欧洲一区二区| 国产精品欧美久久久久一区二区| 在线观看亚洲a| 国产99久久久精品| 麻豆精品一区二区| 亚洲欧美成aⅴ人在线观看| 精品国产sm最大网站| 欧美日韩免费高清一区色橹橹| 国产精品 欧美精品| 秋霞国产午夜精品免费视频| 亚洲欧洲日产国码二区| 欧美不卡一区二区| 91精品婷婷国产综合久久竹菊| 91麻豆视频网站| aaa亚洲精品一二三区| 国产精品一区二区三区乱码| 日韩电影免费在线看| 亚洲一区二区三区四区五区中文| 中文字幕 久热精品 视频在线| 在线电影院国产精品| 欧美三级中文字幕| 91在线精品一区二区| av不卡免费电影| 在线亚洲+欧美+日本专区| 91成人免费网站| 欧美午夜电影在线播放| 欧美精品在线视频| 3d动漫精品啪啪| 日韩美女在线视频| 久久久久久久久久久久电影| 欧美成人性福生活免费看| 91精品国产综合久久精品app| 欧美亚洲图片小说| 欧美一区二区三区男人的天堂| 日韩精品在线一区二区| 欧美精品一区二区三区视频| 337p粉嫩大胆色噜噜噜噜亚洲| www国产精品av| 中文字幕日韩一区| 亚洲国产精品影院| 国产麻豆精品一区二区| 成人黄色在线看| 91精品免费观看| 国产视频视频一区| 亚洲午夜激情av| 久久国产精品99精品国产| a在线欧美一区| 欧美日韩国产首页在线观看| 久久嫩草精品久久久久| 亚洲久本草在线中文字幕| 九九视频精品免费| 色哟哟日韩精品| 国产亚洲欧美日韩俺去了| 一区二区三区.www| 成人免费视频app| 欧美一区日韩一区| 亚洲男人天堂av网| 成人一道本在线| 日韩精品一区二区在线| 亚洲国产精品视频| 欧美最猛黑人xxxxx猛交| 国产精品美女www爽爽爽| 久久精品国产99| 日韩免费看的电影| 午夜成人免费视频| 欧美性一级生活| 亚洲精品亚洲人成人网在线播放| 国产成人av在线影院| 久久免费视频一区| 国产在线精品不卡| 久久久精品一品道一区| 国产精品自拍一区| 中文字幕av一区二区三区高| 国产精品99久久久久久有的能看| 精品久久久影院|