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

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

?? ch09.htm

?? 用VC開發ACTIVEX書籍和隨書源碼
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--last modified on Tue, Apr 15, 1997 10:57 AM-->
<HTML>

<HEAD>
<!-- This document was created from RTF source by rtftohtml version 3.0.1 -->

	<META NAME="GENERATOR" Content="Symantec Visual Page 1.0">
	<META NAME="Author" Content="Steph Mineart">
	<META HTTP-EQUIV="Content-Type" CONTENT="text/html;CHARSET=iso-8859-1">
	<TITLE>Chapter 9</TITLE>
</HEAD>

<BODY BACKGROUND="../images/r2harch.gif" TEXT="#000000" BGCOLOR="#FFFFFF">

<H1>Chapter 9<BR>
Advanced ActiveX Control Development with ATL</H1>

<UL>
	<LI><A HREF="#Heading1">Advanced ActiveX Control Development with ATL</A>
	<UL>
		<LI><A HREF="#Heading2">Properties</A>
		<UL>
			<LI><A HREF="#Heading3">Creating Asynchronous Properties</A>
			<LI><A HREF="#Heading4">Listing 9.1 ATLCONTROL.IDL--Change the dispid of the ReadyState
			Property to the Stock Property dispid--DISPID_READYSTATE</A>
			<LI><A HREF="#Heading5">Listing 9.2 ATLCONTROLWIN.H--Add the m_lReadyState Member
			to the CATLControlWin Class</A>
			<LI><A HREF="#Heading6">Listing 9.3 ATLCONTROLWIN.H--Initialize the m_lReadyState
			Member Variable in the Class Constructor</A>
			<LI><A HREF="#Heading7">Listing 9.4 ATLCONTROLWIN.CPP--Implement the get_ReadyState
			Function to Return the Current ReadyState Value</A>
			<LI><A HREF="#Heading8">Listing 9.5 ATLCONTROL.IDL--Add the ReadyStateChange Event
			to the IDL File</A>
			<LI><A HREF="#Heading9">Listing 9.6 ATLCONTROL.IDL--Add the dispidTextDataPath Enumeration
			to the IDL File</A>
			<LI><A HREF="#Heading10">Listing 9.7 ATLCONTROLWIN.H--The m_bstrTextDataPath Member
			Variable Is Added to the Class Declaration to Store the TextDataPath Property</A>
			<LI><A HREF="#Heading11">Listing 9.8 ATLCONTROLWIN.CPP--Implementation of the get_TextDataPath
			/put_TextDataPath Functions</A>
			<LI><A HREF="#Heading12">Listing 9.9 ATLCONTROLWIN.CPP--OnData Function Implementation</A>
			<LI><A HREF="#Heading13">Listing 9.10 ATLCONTROLWIN.H--TextDataPath Member Added
			to the Property Persistence Macro</A>
			<LI><A HREF="#Heading14">Static and Dynamic Property Enumeration</A>
			<LI><A HREF="#Heading15">Listing 9.11 ATLCONTROLWIN.H--IPerPropertyBrowsing Interface
			Function Prototypes Must Be Added to the Class Declaration</A>
			<LI><A HREF="#Heading16">Listing 9.12 ATLCONTROLWIN.CPP--MapPropertyToPage Implementation</A>
			<LI><A HREF="#Heading17">Listing 9.13 ATLCONTROLWIN.CPP--GetPredefinedStrings Implementation</A>
			<LI><A HREF="#Heading18">Listing 9.14 ATLCONTROLWIN.CPP--GetPredefinedValue Implementation</A>
			<LI><A HREF="#Heading19">Listing 9.15 ATLCONTROLWIN.CPP--GetDisplayString Implementation</A>
		</UL>
		<LI><A HREF="#Heading20">Drawing the Control</A>
		<UL>
			<LI><A HREF="#Heading21">Optimized Drawing</A>
			<LI><A HREF="#Heading22">Listing 9.16 ATLCONTROLWIN.H--Drawing Implementation Member
			Variables and Functions</A>
			<LI><A HREF="#Heading23">Listing 9.17 ATLCONTROLWIN.CPP--OnDestroy Implementation
			of Drawing Resource Cleanup</A>
			<LI><A HREF="#Heading24">Listing 9.18 ATLCONTROLWIN.CPP--OnDraw Function Updated
			to Support Optimized Drawing</A>
		</UL>
		<LI><A HREF="#Heading25">Adding Clipboard and Drag and Drop Support</A>
		<UL>
			<LI><A HREF="#Heading26">Clipboard Support</A>
			<LI><A HREF="#Heading27">Listing 9.19 ATLCONTROLWIN.H--WM_KEYDOWN and OnKeyDown Message
			Handler Added to the Class Declaration of the Control</A>
			<LI><A HREF="#Heading28">Listing 9.20 ATLCONTROLWIN.CPP--OnKeyDown Implementation</A>
			<LI><A HREF="#Heading29">Listing 9.21 ATLCONTROLWIN.H--Helper Functions and Member
			Variables for Clipboard Support</A>
			<LI><A HREF="#Heading30">Listing 9.22 ATLCONTROLWIN.H--IEnumFORMATETC Interface Added
			to theClass Inheritance Hierarchy</A>
			<LI><A HREF="#Heading31">Listing 9.23 ATLCONTROLWIN.H--Member Initialization in the
			Class Constructor</A>
			<LI><A HREF="#Heading32">Listing 9.24 ATLCONTROLWIN.CPP--CopyDataToClipboard Helper
			Function Implementation</A>
			<LI><A HREF="#Heading33">Listing 9.25 ATLCONTROLWIN.CPP--PrepareDataForTransfer Helper
			Function Implementation</A>
			<LI><A HREF="#Heading34">Listing 9.26 ATLCONTROLWIN.CPP--CopyStgMedium Helper Function
			Implementation</A>
			<LI><A HREF="#Heading35">Listing 9.27 ATLCONTROLWIN.CPP--IDataObject Interface Implementation</A>
			<LI><A HREF="#Heading36">Listing 9.28 ATLCONTROLWIN.CPP--IEnumFORMATETC Interface
			Implementation</A>
			<LI><A HREF="#Heading37">Listing 9.29 ATLCONTROLWIN.H--Clipboard Target Support Helper
			Function Prototypes</A>
			<LI><A HREF="#Heading38">Listing 9.30 MFCCONTROLWINCTL.CPP--GetDataFromClipboard
			Implementation</A>
			<LI><A HREF="#Heading39">Listing 9.31 MFCCONTROLWINCTL.CPP--GetDataFromTransfer Implementation</A>
			<LI><A HREF="#Heading40">Listing 9.32 ATLCONTROLWIN.CPP--OnKeyDown Implementation</A>
			<LI><A HREF="#Heading41">Drag and Drop Support</A>
			<LI><A HREF="#Heading42">Listing 9.33 ATLCONTROLWIN.H--IDropSource Interface Added
			to the CATLControlWin Class Declaration</A>
			<LI><A HREF="#Heading43">Listing 9.34 ATLCONTROLWIN.H--WM_LBUTTONDOWN and OnLButtonDown
			Message Handler Added to the Class Declaration of the Control</A>
			<LI><A HREF="#Heading44">Listing 9.35 ATLCONTROLWIN.CPP--OnLButtonDown Implementation</A>
			<LI><A HREF="#Heading45">Listing 9.36 ATLCONTROLWIN.CPP--IDropSource Implementation</A>
			<LI><A HREF="#Heading46">Listing 9.37 ATLCONTROLWIN.H--IDropTarget Interface Added
			to the CATLControlWin Class Declaration</A>
			<LI><A HREF="#Heading47">Listing 9.38 ATLCONTROLWIN.H--WM_CREATE Message Handler</A>
			<LI><A HREF="#Heading48">Listing 9.39 ATLCONTROLWIN.CPP--OnCreate Implementation</A>
			<LI><A HREF="#Heading49">Listing 9.40 ATLCONTROLWIN.CPP--OnDestroy Implementation
			Updated to Revoke the Control as a Valid Drop Target</A>
			<LI><A HREF="#Heading50">Listing 9.41 ATLCONTROLWIN.CPP--IDropTarget Interface Implementation</A>
			<LI><A HREF="#Heading51">Custom Clipboard and Drag and Drop Formats</A>
			<LI><A HREF="#Heading52">Listing 9.42 ATLCONTROLWIN.H--Custom Data Format Member
			Variables</A>
			<LI><A HREF="#Heading53">Listing 9.43 ATLCONTROLWIN.H--Register the Custom Format
			and Initialize the Member Variables in the Class Constructor</A>
			<LI><A HREF="#Heading54">Listing 9.44 ATLCONTROLWIN.CPP--PrepareDataForTransfer Update</A>
			<LI><A HREF="#Heading55">Listing 9.45 ATLCONTROLWIN.CPP--GetDataFromTransfer Update</A>
			<LI><A HREF="#Heading56">Listing 9.46 ATLCONTROLWIN.CPP--IEnumFORMATETC::Next Update</A>
			<LI><A HREF="#Heading57">Listing 9.47 TLCONTROLWIN.CPP--IEnumFORMATETC::GetData Update</A>
		</UL>
		<LI><A HREF="#Heading58">Subclassing Existing Windows Controls</A>
		<UL>
			<LI><A HREF="#Heading59">Listing 9.48 ATLCONTROLSUBWIN.H--CATLControlSubWin Class
			Implementation</A>
		</UL>
		<LI><A HREF="#Heading60">Dual-Interface Controls</A>
		<LI><A HREF="#Heading61">Other ActiveX Features</A>
		<UL>
			<LI><A HREF="#Heading62">Windowless Activation</A>
			<LI><A HREF="#Heading63">Flicker-Free Activation</A>
			<LI><A HREF="#Heading64">Mouse Pointer Notifications When Inactive</A>
			<LI><A HREF="#Heading65">Optimized Drawing Code</A>
			<LI><A HREF="#Heading66">Loads Properties Asynchronously</A>
		</UL>
		<LI><A HREF="#Heading67">From Here...</A>
	</UL>
</UL>

<P>
<HR SIZE="4">

<H1><A NAME="Heading1"></A>Advanced ActiveX Control Development with ATL</H1>

<UL>
	<LI><B>Asynchronous properties</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 ATL hides some of the implementation details making implementation easier.
	<P>
	<LI><B> Property enumeratio</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 Property enumeration allows you to restrict the set of values a property can contain
	and makes the property appear more professional in its implementation.
	<P>
	<LI><B>Optimized drawing</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 Optimized drawing with ATL is easy and can have positive effects on the performance
	and appearance of the control.
	<P>
	<LI><B>Clipboard and Drag and Drop</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 With ATL, you can use a set of routines that includes support for custom data types.
	<P>
	<LI><B>Subclassing Windows controls</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 Subclassing an existing Windows control with ATL can significantly reduce your development
	time when creating new controls.
	<P>
	<LI><B>Dual-interface controls</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 Unlike MFC, ATL ActiveX controls are dual-interface by default and require no extra
	work to implement.
	<P>
	<LI><B>Advanced ActiveX</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 The ATL framework provides advanced features by default.
</UL>

<P>This chapter expands upon the information in <A HREF="ch08.htm">Chapter 8</A>
about creating a basic ATL ActiveX control. In addition to the features that you
are familiar with, such as Clipboard and Drag and Drop support, you will learn how
to implement asynchronous properties and optimized drawing, which are the result
of the adoption of OLE Control 96 (OC 96) specification.
<H2><A NAME="Heading2"></A>Properties</H2>
<H2>Properties</H2>
<P>In <A HREF="ch08.htm">Chapter 8</A>, you learn how to add the various types of
properties to your control implementation. One type of property that has yet to be
examined in terms of ATL is asynchronous properties.
<H3><A NAME="Heading3"></A>Creating Asynchronous Properties</H3>
<P>Asynchronous properties are those properties that typically represent a large
amount of data, such as a text file or a bitmap, and are loaded as a background process
so as not to interfere with the normal processing of the control and the container.
This statement can be somewhat misleading. Asynchronous refers only to the call to
load the data; it does not refer to the actual loading.</P>
<P>For example, a control uses a bitmap as its background and has defined the bitmap
as an asynchronous property. If OLE determines that the bitmap is already on the
local machine, the data is considered to be available to the control and, subsequently,
will instruct the control that all of the data is available. If OLE determines that
the bitmap is not available on the local machine, OLE will load the data as fast
as possible and inform the control as data becomes available. After the data is in
a location that is considered accessible, the property essentially behaves as any
other property would. If you require the asynchronous loading of the data regardless
of its location, you must implement it yourself.</P>
<P>Before you can add your asynchronous property, you need to add the property <TT>ReadyState</TT>,
which is used by the container to determine the state that the control is in at any
given time relative to the loading of asynchronous properties. You also add the event
<TT>ReadyStateChange</TT>, which is used by the control to notify the container that
the <TT>ReadyState</TT> property of the control has changed.</P>
<P>Adding the <TT>ReadyState</TT> property is the same as adding any other property,
as is described in <A HREF="ch08.htm">Chapter 8</A>. From the ClassView tab in the
Project Workspace window, select the <TT>IATLControlWin</TT> interface, click the
right mouse button, and select the Add <U>P</U>roperty menu item.</P>
<P>In the Add Property to Interface dialog, set the Property <U>T</U>ype to <TT>long</TT>,
the Property <U>N</U>ame to <TT>ReadyState</TT>, uncheck the <U>P</U>ut Function
check box, and leave the remainder of the settings at their default values (see fig.
9.1). Click OK to confirm the entry, and close the dialog.</P>
<P>Before you proceed, open the ATLControl.idl file, and change the <TT>dispid</TT>
of the <TT>ReadyState</TT> property to <TT>DISPID_READYSTATE</TT> since <TT>ReadyState</TT>
is a stock property (see Listing 9.1). <B><BR>
<BR>
</B><A HREF="Art/09/xfigs01.jpg"><B>FIG. 9.1</B></A> <BR>
<I>Add the <TT>ReadyState </TT>property to the control using the ATL Object Wizard
for your asynchronous property support.</I></P>
<P>
<H3><A NAME="Heading4"></A>Listing 9.1<SPACER TYPE="HORIZONTAL" SIZE="10"> ATLCONTROL.IDL--Change
the dispid of the ReadyState Property to the Stock Property dispid--DISPID_READYSTATE</H3>
<P><FONT COLOR="#0066FF"><TT>. . . <BR>
interface IATLControlWin : IDispatch <BR>
{ <BR>
[id(1), helpstring(&quot;method CaptionMethod&quot;)] HRESULT CaptionMethod( <BR>
[in] BSTR bstrCaption, [in, optional] VARIANT varAlignment, <BR>
[out, retval] long * lRetVal); <BR>
[propget, id(DISPID_READYSTATE), helpstring(&quot;property ReadyState&quot;)] <BR>
HRESULT ReadyState([out, retval] long *pVal); <BR>
[propget, id(DISPID_BACKCOLOR), helpstring(&quot;property BackColor&quot;)] <BR>
HRESULT BackColor([out, retval] OLE_COLOR *pVal); <BR>
[propput, id(DISPID_BACKCOLOR), helpstring(&quot;property BackColor&quot;)] <BR>
HRESULT BackColor([in] OLE_COLOR newVal); <BR>
[propget, id(dispidCaptionProp), helpstring(&quot;property CaptionProp&quot;)] <BR>
HRESULT CaptionProp([in, optional] VARIANT varAlignment, <BR>
[out, retval] BSTR *pVal); <BR>
[propput, id(dispidCaptionProp), helpstring(&quot;property CaptionProp&quot;)] <BR>
HRESULT CaptionProp([in, optional] VARIANT varAlignment, <BR>
[in] BSTR newVal); <BR>
[propget, id(dispidAlignment), helpstring(&quot;property Alignment&quot;)] <BR>
HRESULT Alignment([out, retval] long *pVal); <BR>
[propput, id(dispidAlignment), helpstring(&quot;property Alignment&quot;)] <BR>
HRESULT Alignment([in] long newVal); <BR>
}; <BR>
<BR>
. . . </TT></FONT></P>

<P>The implementation of the <TT>ReadyState</TT> property requires a member variable
to store the <TT>ReadyState</TT> value. Add the <TT>m_lReadyState</TT> member to
the class declaration of the <TT>CATLControlWin</TT> class (see Listing 9.2).
<H3><A NAME="Heading5"></A>Listing 9.2<SPACER TYPE="HORIZONTAL" SIZE="10"> ATLCONTROLWIN.H--Add
the m_lReadyState Member to the CATLControlWin Class</H3>
<P><FONT COLOR="#0066FF"><TT>. . . <BR>
int iCharWidthArray[256]; <BR>
int iCharacterSpacing, iCharacterHeight; <BR>
// for the ReadyState property <BR>
long m_lReadyState; <BR>
}; <BR>
</TT></FONT></P>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
日韩写真欧美这视频| 亚洲一区在线电影| 亚洲国产aⅴ天堂久久| 极品少妇xxxx精品少妇偷拍 | 国产日韩精品视频一区| 悠悠色在线精品| 国产成人综合在线播放| 欧美福利电影网| 中文字幕亚洲精品在线观看| 日本vs亚洲vs韩国一区三区| 在线免费观看日本欧美| 久久免费视频色| 日本不卡视频在线观看| 欧美综合一区二区| 日韩一区日韩二区| 国产高清精品网站| 精品sm在线观看| 毛片av一区二区| 日韩一二在线观看| 日本美女视频一区二区| 欧美麻豆精品久久久久久| 亚洲欧洲美洲综合色网| 福利一区二区在线观看| 久久综合色8888| 经典三级视频一区| 久久综合九色综合久久久精品综合| 天堂成人免费av电影一区| 91成人在线精品| 亚洲永久精品国产| 精品视频一区三区九区| 婷婷六月综合亚洲| 欧美一区二区三区免费大片| 免费观看在线色综合| 欧美日韩免费视频| 亚洲成人av中文| 狠狠v欧美v日韩v亚洲ⅴ| 欧美日韩成人综合在线一区二区 | 日韩视频一区二区三区| 亚洲猫色日本管| 成人精品国产一区二区4080| 久久午夜羞羞影院免费观看| 奇米一区二区三区av| 欧美日韩你懂得| 亚洲一区二区偷拍精品| 99re热这里只有精品视频| 久久精品亚洲麻豆av一区二区 | 波多野结衣91| 中文字幕欧美区| 成人av在线网| 国产精品系列在线| 成人免费视频播放| 国产精品丝袜91| 国产69精品久久久久777| 日韩午夜av一区| 亚洲男同性恋视频| 成人av网站在线| 1024成人网色www| 色老头久久综合| 天堂久久一区二区三区| 欧美一区午夜视频在线观看 | 欧美精品一区二区三区在线播放| 美女视频黄 久久| 日韩欧美国产一区二区在线播放| 免费高清在线视频一区·| 91精品国产欧美一区二区| 日本成人中文字幕| www久久久久| 成人免费看黄yyy456| 国产日本一区二区| 一本久久综合亚洲鲁鲁五月天 | 日韩av成人高清| 欧美精品一级二级| 久久国产欧美日韩精品| 久久久久国色av免费看影院| 成人禁用看黄a在线| 亚洲黄色免费网站| 欧美大片在线观看| 国产精品系列在线观看| 亚洲另类在线视频| 欧洲激情一区二区| 狠狠网亚洲精品| 国产精品灌醉下药二区| 欧美日韩在线免费视频| 久久99国产精品麻豆| 日韩一区日韩二区| 欧美一区二区三区系列电影| 成人手机电影网| 日韩精品一二三| 国产精品人妖ts系列视频| 91日韩精品一区| 激情欧美日韩一区二区| 自拍偷拍亚洲激情| 日韩欧美在线观看一区二区三区| 成人亚洲一区二区一| 午夜精品一区二区三区电影天堂| 国产亚洲精品久| 欧美久久一区二区| av激情亚洲男人天堂| 蜜臀av一级做a爰片久久| 国产欧美日本一区视频| 精品乱码亚洲一区二区不卡| 色婷婷综合久久久久中文一区二区| 日韩成人午夜电影| 综合激情网...| 久久综合色8888| 欧美精品久久一区| 一本大道久久a久久综合婷婷| 久久精品二区亚洲w码| 伊人夜夜躁av伊人久久| 国产精品视频一二| 26uuu欧美| 久久精品亚洲精品国产欧美| 91精品福利在线一区二区三区| 一本色道久久加勒比精品 | 国产成都精品91一区二区三| 日本一区中文字幕| 亚洲在线免费播放| 18涩涩午夜精品.www| 久久久久国产精品麻豆ai换脸| 91精品国产欧美日韩| 欧美网站一区二区| 欧美午夜片在线观看| 一本一本久久a久久精品综合麻豆| 大胆亚洲人体视频| 青青草国产成人av片免费| 奇米精品一区二区三区四区| 亚洲综合激情网| 亚洲一区二区不卡免费| 亚洲色欲色欲www| 亚洲欧洲性图库| 中文字幕一区二区日韩精品绯色| 国产视频一区在线播放| 久久久久免费观看| 久久久www免费人成精品| 精品国产麻豆免费人成网站| 欧美性受极品xxxx喷水| 欧美三级韩国三级日本一级| 一本色道**综合亚洲精品蜜桃冫 | 欧美高清精品3d| 91精品午夜视频| 欧美日韩欧美一区二区| 精品视频1区2区3区| 欧美久久久久免费| 日韩美女视频在线| 久久综合视频网| 国产精品女主播在线观看| 国产精品人人做人人爽人人添| 中文字幕一区二区不卡| 亚洲人成网站精品片在线观看| 亚洲一区二区三区四区在线免费观看| 亚洲手机成人高清视频| 久久久久久免费毛片精品| 精品国产一区二区三区久久久蜜月 | 日本一不卡视频| 韩国在线一区二区| 成人精品小蝌蚪| 国产精品亚洲一区二区三区妖精| 国产激情视频一区二区在线观看| 成人在线综合网| 在线观看一区二区视频| 欧美一区二区播放| 国产清纯美女被跳蛋高潮一区二区久久w| 国产欧美一区二区在线观看| 亚洲激情中文1区| 免费高清在线一区| 成人免费毛片嘿嘿连载视频| 欧美在线小视频| 欧美一区二区在线免费播放 | 蜜桃精品在线观看| 国产成人精品免费看| 在线观看一区不卡| 欧美日本高清视频在线观看| 欧美精品亚洲二区| 国产偷v国产偷v亚洲高清| 一区二区三区.www| 久久精品国产99久久6| 97精品国产97久久久久久久久久久久| 欧美日韩高清在线播放| 久久久精品天堂| 视频一区中文字幕| www.在线欧美| 日韩精品一区二区三区在线| 国产精品日韩精品欧美在线| 久久精品999| 欧美日韩黄视频| 国产精品久久久久一区| 热久久久久久久| 在线视频综合导航| 国产亲近乱来精品视频| 日本网站在线观看一区二区三区| 99视频一区二区| 欧美一级日韩免费不卡| 亚洲国产精品久久人人爱蜜臀| 国产传媒日韩欧美成人| 日韩一级视频免费观看在线| 亚洲精品精品亚洲| 99视频精品全部免费在线| 久久免费精品国产久精品久久久久| 午夜日韩在线电影| 欧美性做爰猛烈叫床潮|