亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
激情五月婷婷综合网| 欧美性大战xxxxx久久久| 波多野结衣在线一区| 91精彩视频在线观看| 欧美tk—视频vk| 亚洲高清免费在线| 白白色亚洲国产精品| 制服丝袜中文字幕亚洲| 夜夜亚洲天天久久| 成年人国产精品| 国产亚洲人成网站| 久久精品国产精品亚洲综合| 一本一道综合狠狠老| 国产精品美女久久久久久久久 | av在线不卡观看免费观看| 欧美日韩成人综合| 亚洲男人电影天堂| 岛国精品在线播放| 久久久久久日产精品| 久久99热狠狠色一区二区| 欧美伦理视频网站| 亚洲高清免费在线| 欧美日本一区二区在线观看| 亚洲免费在线电影| 91视频精品在这里| 中文字幕一区二区不卡| 成人av资源在线| 国产精品久久久一区麻豆最新章节| 激情五月婷婷综合网| 欧美精品一区二区三区蜜桃视频 | 国产精品99久久久久久久vr| 日韩欧美在线网站| 精品亚洲国产成人av制服丝袜| 日韩视频在线你懂得| 欧美色涩在线第一页| 亚洲女爱视频在线| 欧美午夜不卡视频| 视频一区国产视频| 日韩一区二区三区精品视频| 久久国产人妖系列| 欧美激情一区三区| 91麻豆国产在线观看| 亚洲午夜在线视频| 91麻豆精品国产无毒不卡在线观看 | 亚洲gay无套男同| 制服丝袜中文字幕亚洲| 麻豆精品在线播放| 国产亚洲欧美日韩日本| 波多野结衣精品在线| 一区二区三区在线播| 欧美电影在哪看比较好| 久色婷婷小香蕉久久| 欧美激情一区在线观看| 色狠狠色噜噜噜综合网| 日本在线不卡视频一二三区| 久久蜜臀中文字幕| 91原创在线视频| 七七婷婷婷婷精品国产| 国产亚洲1区2区3区| 在线精品国精品国产尤物884a| 美女视频一区在线观看| 中文字幕巨乱亚洲| 欧美高清视频一二三区| 国产成人在线网站| 亚洲午夜久久久久久久久久久| 欧美电影免费观看高清完整版| 成人午夜av电影| 日韩在线一区二区三区| 国产日产欧美精品一区二区三区| 日本韩国精品一区二区在线观看| 奇米影视一区二区三区小说| 亚洲国产精品ⅴa在线观看| 欧美日韩一区二区三区四区| 国产精品一区二区91| 亚洲综合在线观看视频| 国产亚洲综合在线| 欧美久久久久免费| 成人av网站免费观看| 狂野欧美性猛交blacked| 自拍偷拍亚洲欧美日韩| 久久先锋影音av| 欧美亚洲一区三区| 丁香婷婷综合激情五月色| 日韩国产欧美三级| 最新日韩av在线| 久久麻豆一区二区| 在线观看91av| 在线一区二区三区四区| 国产成人亚洲综合a∨婷婷| 天天爽夜夜爽夜夜爽精品视频| 欧美国产丝袜视频| xf在线a精品一区二区视频网站| 欧美性生活久久| gogo大胆日本视频一区| 国产一区二区三区日韩| 视频在线观看一区二区三区| 一区二区在线观看av| 国产精品久久久久久亚洲伦| 日韩欧美国产系列| 欧美人与禽zozo性伦| 91亚洲精品乱码久久久久久蜜桃| 国产电影一区二区三区| 久久99精品国产.久久久久久| 亚洲成av人片观看| 一区二区三区成人在线视频| 国产精品视频麻豆| 中文子幕无线码一区tr| 久久精品一级爱片| 国产日本欧洲亚洲| 久久久久久**毛片大全| 久久嫩草精品久久久久| 精品国产sm最大网站| 欧美成人猛片aaaaaaa| 91精品国产综合久久国产大片| 91国在线观看| 欧美日韩高清不卡| 欧美乱熟臀69xxxxxx| 在线播放中文字幕一区| 制服丝袜亚洲网站| 欧美大胆人体bbbb| 精品99一区二区| 久久久综合视频| 国产精品伦理在线| 自拍偷在线精品自拍偷无码专区| 亚洲色图20p| 亚洲午夜激情av| 免费精品视频最新在线| 精品亚洲成a人在线观看| 国产美女在线精品| 成人黄动漫网站免费app| 色天使色偷偷av一区二区| 欧美日韩在线三级| 日韩你懂的在线播放| 久久蜜桃av一区二区天堂| 日本一区二区三区在线观看| 亚洲欧洲性图库| 偷窥少妇高潮呻吟av久久免费| 麻豆精品在线播放| 成人小视频在线| 欧美日韩美少妇| 精品久久久久久久久久久久久久久 | 欧美一区二区三区免费在线看| 日韩三级中文字幕| 日本一区二区成人| 一区二区三区在线视频免费 | 夜夜嗨av一区二区三区网页| 五月天亚洲精品| 精品无码三级在线观看视频| 国产成人精品免费网站| 色噜噜狠狠色综合中国| 91精品国产一区二区三区蜜臀 | 欧美韩国日本一区| 亚洲免费观看高清完整版在线观看熊| 亚洲va国产va欧美va观看| 国产一区二区美女| 欧美最新大片在线看| 国产午夜一区二区三区| 亚洲成av人片一区二区梦乃 | 亚洲视频在线一区| 蜜臀久久久久久久| 99精品欧美一区| 日韩欧美一区二区在线视频| 国产午夜精品一区二区三区嫩草| 亚洲成人av中文| a亚洲天堂av| 精品三级av在线| 亚洲午夜精品17c| av一区二区三区| 26uuu久久天堂性欧美| 亚洲一卡二卡三卡四卡五卡| 国产精品一区专区| 欧美浪妇xxxx高跟鞋交| 亚洲欧美综合在线精品| 国产在线视频一区二区三区| 欧美久久一区二区| 综合久久久久综合| 国产精品888| 777xxx欧美| 亚洲福利视频三区| 色国产综合视频| 一区在线观看视频| 国产精品一二三四五| 7777精品伊人久久久大香线蕉完整版| 综合在线观看色| 国产成人99久久亚洲综合精品| 日韩亚洲欧美一区| 日韩精品一二三区| 欧美日韩成人一区| 午夜激情综合网| 欧美在线啊v一区| 亚洲人妖av一区二区| 成人免费高清在线观看| xnxx国产精品| 国产一区二区精品在线观看| 欧美大片国产精品| 精油按摩中文字幕久久| 26uuu精品一区二区三区四区在线| 麻豆freexxxx性91精品| 日韩精品一区二区在线| 九九九精品视频|