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

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

?? ch24.htm

?? 24小時學(xué)會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>

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美精品久久久久久久多人混战| 91蝌蚪porny九色| 天堂资源在线中文精品| 亚洲人成网站在线| 亚洲伦在线观看| 亚洲精品免费在线| 亚洲一卡二卡三卡四卡五卡| 一区二区三区中文字幕在线观看| 亚洲人成人一区二区在线观看 | 国产精品国产自产拍高清av王其 | 亚洲一区二区视频| 亚洲国产成人av好男人在线观看| 亚洲专区一二三| 日韩电影免费一区| 国产一区二区电影| 波多野结衣欧美| 91福利国产精品| 欧美另类久久久品| 精品久久久久99| 国产欧美一区二区精品性色超碰| 国产精品久久久一本精品| 亚洲欧美日本在线| 日韩和欧美的一区| 韩国精品主播一区二区在线观看 | 午夜久久久影院| 日韩av在线免费观看不卡| 久久99国产乱子伦精品免费| 国产在线一区二区综合免费视频| 丰满放荡岳乱妇91ww| 91在线观看成人| 欧美日韩电影一区| 久久这里只精品最新地址| 国产精品亲子伦对白| 亚洲va欧美va人人爽| 日韩 欧美一区二区三区| 国产一区二三区| 色综合久久九月婷婷色综合| 欧美日韩免费在线视频| 精品国产91亚洲一区二区三区婷婷 | 精品日韩在线观看| 久久久精品蜜桃| 中文字幕一区二区三区av| 一区二区三区免费看视频| 天堂一区二区在线免费观看| 蜜臀va亚洲va欧美va天堂| a在线播放不卡| 欧美一区二区日韩| 国产精品网站在线播放| 亚洲第一在线综合网站| 国产精品资源站在线| 色天天综合色天天久久| 欧美videossexotv100| 色婷婷av一区二区三区gif| 91精品国产91久久久久久最新毛片| 日韩一区二区三区精品视频| 国产精品乱人伦中文| 亚洲午夜电影在线| 国产成人一区在线| 欧美美女黄视频| 自拍偷拍欧美激情| 国产成人鲁色资源国产91色综| 色哟哟国产精品免费观看| 久久你懂得1024| 亚洲成人动漫精品| 色综合激情五月| 2023国产精品| 国内成+人亚洲+欧美+综合在线| 99久久久精品免费观看国产蜜| 日韩免费一区二区三区在线播放| 免费成人av资源网| 国产精品一区二区在线看| 国产精品欧美久久久久无广告| 青青草国产精品97视觉盛宴| 26uuu精品一区二区 | 高潮精品一区videoshd| 懂色av中文一区二区三区| 久久日韩精品一区二区五区| 欧美日韩一区在线| 奇米色777欧美一区二区| 国产精品日韩精品欧美在线| 麻豆成人在线观看| 欧美日高清视频| 懂色av中文字幕一区二区三区| 日韩一级精品视频在线观看| 午夜精品福利一区二区三区av| 91免费版pro下载短视频| 欧美精品一区二区三区高清aⅴ| 午夜精品久久久久久不卡8050| 91在线视频网址| 亚洲国产精品成人综合| 国产激情一区二区三区四区 | 国产精品美女久久久久久久久 | 亚洲午夜久久久| 91亚洲精品乱码久久久久久蜜桃| 国产日韩欧美一区二区三区乱码 | 麻豆国产精品官网| 日韩亚洲国产中文字幕欧美| 天天影视涩香欲综合网| 欧美日本在线视频| 日本午夜一本久久久综合| 欧美高清www午色夜在线视频| 亚洲精品v日韩精品| 一本一道久久a久久精品| 亚洲精品日韩一| 在线日韩国产精品| 亚洲一区二区三区四区中文字幕| 一本到不卡免费一区二区| 亚洲欧美中日韩| 一本久久a久久精品亚洲| 樱桃视频在线观看一区| 欧美在线免费视屏| 日韩电影在线观看一区| 日韩欧美在线1卡| 国内精品伊人久久久久av一坑| 国产视频一区不卡| www.日韩在线| 亚洲精品美国一| 欧美日韩精品高清| 奇米色777欧美一区二区| 久久蜜臀精品av| 不卡av电影在线播放| 亚洲精品免费电影| 717成人午夜免费福利电影| 美国十次综合导航| 欧美国产激情二区三区| 一本久久综合亚洲鲁鲁五月天 | 亚洲最大成人综合| 欧美日韩午夜精品| 精品中文字幕一区二区| 国产欧美日本一区二区三区| www.久久久久久久久| 亚洲与欧洲av电影| 91精品国产91久久久久久一区二区| 捆绑调教一区二区三区| 中文字幕在线一区免费| 欧美三电影在线| 国产一区二区三区黄视频 | 欧美日本一区二区在线观看| 蜜桃视频在线一区| 久久亚洲一区二区三区四区| av中文一区二区三区| 午夜精品一区二区三区三上悠亚 | 男女男精品网站| 国产精品色在线| 欧美精品精品一区| 福利一区在线观看| 欧美日韩成人一区| 日韩三级中文字幕| 精品99一区二区| 国产日韩欧美高清| 国产精品看片你懂得| 综合色天天鬼久久鬼色| 亚洲天堂免费在线观看视频| 亚洲欧美经典视频| 日韩在线卡一卡二| 不卡的av在线播放| 欧美手机在线视频| 精品久久人人做人人爰| 国产精品视频免费| 亚洲一区二区视频在线观看| 全部av―极品视觉盛宴亚洲| 国产黄色91视频| 在线亚洲精品福利网址导航| 精品国产乱码久久久久久老虎| 久久综合给合久久狠狠狠97色69| 香蕉乱码成人久久天堂爱免费| 久久99国产精品免费| 欧美一区二区三区在线电影 | 91精品免费在线观看| 午夜视黄欧洲亚洲| 欧美一区二区精品在线| 日韩电影网1区2区| 欧美日韩在线播| 精品国产成人在线影院| 亚洲免费高清视频在线| 蜜桃一区二区三区在线观看| 日本电影欧美片| 国产亚洲人成网站| 欧美日韩黄色一区二区| 国产91精品欧美| 欧美日本高清视频在线观看| 丁香激情综合五月| 久久av资源站| 人人狠狠综合久久亚洲| 亚洲一区在线视频观看| 最新国产成人在线观看| 国产欧美视频在线观看| 精品欧美黑人一区二区三区| 欧美精品vⅰdeose4hd| 色狠狠桃花综合| 97精品电影院| 99久久精品免费精品国产| 处破女av一区二区| 国产大陆亚洲精品国产| 国内偷窥港台综合视频在线播放| 麻豆精品久久精品色综合| 日韩成人午夜电影| 欧美aa在线视频| 免费观看成人av| 看电影不卡的网站|