亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
国产精品免费av| 色一情一乱一乱一91av| 国产欧美视频一区二区三区| 欧美在线观看一二区| 另类成人小视频在线| 国产精品视频第一区| av成人免费在线观看| 亚洲超碰精品一区二区| 久久―日本道色综合久久| 色婷婷国产精品综合在线观看| 精品一区二区三区日韩| 中文字幕欧美一| 日韩一级完整毛片| av中文字幕一区| 国产久卡久卡久卡久卡视频精品| 亚洲精品国产一区二区精华液| 精品国产人成亚洲区| 欧美挠脚心视频网站| 不卡av电影在线播放| 免费在线观看视频一区| 欧美激情在线免费观看| 精品91自产拍在线观看一区| 色av成人天堂桃色av| 韩国毛片一区二区三区| 青青青伊人色综合久久| 亚洲精品国产一区二区三区四区在线| 精品久久一区二区三区| 一本大道av一区二区在线播放| 国产美女精品人人做人人爽| 亚洲成av人片在www色猫咪| 亚洲国产高清aⅴ视频| 日韩久久精品一区| 欧美日韩精品福利| 99久久国产综合精品女不卡| 成人毛片在线观看| 国产成人精品免费网站| 蜜桃久久精品一区二区| 免费精品99久久国产综合精品| 伊人一区二区三区| 亚洲欧洲www| 国产无一区二区| 国产精品欧美一级免费| 精品99一区二区三区| 精品理论电影在线观看 | 玉足女爽爽91| 国产精品二三区| 国产精品嫩草影院av蜜臀| 日韩欧美一区二区在线视频| 欧美一卡二卡在线观看| 91精品国产综合久久久久久久 | 国产精品家庭影院| 欧美极品另类videosde| 久久免费看少妇高潮| 色婷婷亚洲婷婷| 欧美日韩亚洲综合| 欧美日韩精品福利| 欧美日韩精品二区第二页| 91精品在线观看入口| 制服丝袜av成人在线看| 欧美一区二区视频在线观看 | 欧美性色欧美a在线播放| 在线免费观看日韩欧美| 欧美精品在线观看播放| 欧美一级免费观看| 日韩欧美国产午夜精品| 日韩欧美在线网站| 国产欧美一区二区精品婷婷| 国产精品视频一二三区| 国产精品久久久久久亚洲毛片| 国产欧美中文在线| 国产精品久久久久影视| 亚洲图片激情小说| 亚洲一区中文日韩| 狠狠久久亚洲欧美| 成人综合激情网| 91九色02白丝porn| 日韩三级.com| 国产精品免费免费| 一区二区三区四区中文字幕| 国产欧美精品一区| 亚洲国产欧美另类丝袜| 日本特黄久久久高潮 | 成人午夜碰碰视频| 欧美日韩在线播| 欧美成人女星排行榜| 国产精品美女久久久久aⅴ国产馆 国产精品美女久久久久av爽李琼 国产精品美女久久久久高潮 | 亚洲成a人片在线不卡一二三区| 亚洲一区二区综合| 捆绑调教美女网站视频一区| 国产超碰在线一区| 欧美性猛交xxxxxx富婆| 国产日韩欧美一区二区三区乱码| 亚洲美女视频在线观看| 美日韩一级片在线观看| 国产剧情一区二区| 欧美吞精做爰啪啪高潮| 久久久久国产精品厨房| 亚洲综合自拍偷拍| 成人教育av在线| 91精品国产麻豆国产自产在线| 日韩精品影音先锋| 亚洲欧美日韩久久精品| 三级亚洲高清视频| 成人黄色a**站在线观看| 色老头久久综合| 久久蜜桃av一区二区天堂| 有坂深雪av一区二区精品| 国产揄拍国内精品对白| 欧美日韩专区在线| 国产精品福利电影一区二区三区四区 | 亚洲毛片av在线| 国内精品免费在线观看| 欧美一三区三区四区免费在线看| 国产精品乱码一区二区三区软件| 日韩激情一区二区| 91网站在线播放| 国产亚洲综合性久久久影院| 亚洲综合精品自拍| 成人国产精品免费观看| 国产午夜精品福利| 另类小说欧美激情| 欧美体内she精视频| 久久精品无码一区二区三区| 人人精品人人爱| 色婷婷综合久久久中文字幕| 日韩一二三区视频| 蜜臀av性久久久久蜜臀aⅴ流畅| 色94色欧美sute亚洲13| 欧美高清在线精品一区| 日韩电影在线看| 欧美三级在线看| 亚洲少妇中出一区| 高清国产一区二区| 中文字幕精品综合| 国产精品88av| 亚洲精品一区二区三区精华液| 亚洲午夜国产一区99re久久| 99re亚洲国产精品| 中文字幕中文在线不卡住| 国产黑丝在线一区二区三区| 日韩午夜激情电影| 久久精品av麻豆的观看方式| 91亚洲精品乱码久久久久久蜜桃| 欧美国产日本视频| 91在线免费看| 亚洲人xxxx| 日本久久精品电影| 一区二区不卡在线视频 午夜欧美不卡在| 粉嫩13p一区二区三区| 久久综合九色综合97_久久久| 狠狠狠色丁香婷婷综合久久五月| 久久久国产午夜精品| 成人黄色免费短视频| 亚洲精品国产视频| 91.xcao| 国产高清无密码一区二区三区| 国产精品人成在线观看免费 | 日韩女优制服丝袜电影| 国产主播一区二区三区| 国产精品传媒在线| 欧美日本高清视频在线观看| 久久国产人妖系列| 国产精品妹子av| 欧美日韩国产在线播放网站| 久久成人免费日本黄色| 中文一区在线播放| 欧美性极品少妇| 韩国v欧美v亚洲v日本v| 亚洲视频一区在线观看| 91精品国产入口在线| 成人亚洲精品久久久久软件| 亚洲午夜久久久久久久久电影院| 91精品国产免费| 99热在这里有精品免费| 亚洲综合色区另类av| 精品国产99国产精品| 91丨porny丨户外露出| 日韩 欧美一区二区三区| 国产女主播视频一区二区| 欧美影片第一页| 国产91精品久久久久久久网曝门| 亚洲美女视频在线观看| 精品国产乱码久久| 欧美一a一片一级一片| 国产成人精品免费| 偷拍一区二区三区| 综合婷婷亚洲小说| 精品日韩在线一区| 欧美视频三区在线播放| 成人毛片老司机大片| 奇米在线7777在线精品| 一区二区三区四区蜜桃| 久久九九国产精品| 欧美久久久久免费| 99在线精品观看| 国产成人自拍高清视频在线免费播放| 天天色图综合网| 一级做a爱片久久| 中文字幕一区二区三区蜜月| 精品福利在线导航|