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

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

?? ch11.htm

?? 用VC開發ACTIVEX書籍和隨書源碼
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
STDMETHOD(get_Alignment)(THIS_ long FAR* Value);<BR>
<BR>
STDMETHOD(put_Alignment)(THIS_ long Value);<BR>
<BR>
STDMETHOD(get_BackColor)(THIS_ OLE_COLOR FAR* Value);<BR>
<BR>
STDMETHOD(put_BackColor)(THIS_ OLE_COLOR Value);<BR>
<BR>
STDMETHOD(get_ReadyState)(THIS_ long FAR* Value);<BR>
<BR>
STDMETHOD(get_TextDataPath)(THIS_ BSTR FAR* bstrRetVal);<BR>
<BR>
STDMETHOD(put_TextDataPath)(THIS_ BSTR Value);<BR>
<BR>
STDMETHOD(CaptionMethod)(THIS_ BSTR bstrCaption, VARIANT varAlignment, <BR>
<BR>
long FAR* lRetVal);<BR>
<BR>
STDMETHOD(get_CaptionProp)(THIS_ VARIANT varAlignment, BSTR FAR* bstrRetVal);<BR>
<BR>
STDMETHOD(put_CaptionProp)(THIS_ VARIANT varAlignment, BSTR lpszNewValue);<BR>
<BR>
STDMETHOD_(void, AboutBox)(THIS); <BR>
. . . <BR>
// private state information.<BR>
<BR>
//<BR>
<BR>
BCFCONTROLCTLSTATE m_state; <BR>
protected:<BR>
<BR>
LPTSTR m_lptstrCaption;<BR>
<BR>
LPTSTR m_lptstrTextDataPath; <BR>
};<BR>
</TT></FONT></P>
<P>Listing 11.7 shows your member variable initialization in your constructor. You
don't need to set any default values since the <TT>ReadyState</TT> will not be persisted
across execution lifetimes.
<H3><A NAME="Heading10"></A>Listing 11.7<SPACER TYPE="HORIZONTAL" SIZE="10"> BCFCONTROLCTL.CPP--Member
Initialization</H3>
<P><FONT COLOR="#0066FF"><TT>#pragma warning(disable:4355) // using `this' in constructor<BR>
<BR>
CBCFControlControl::CBCFControlControl<BR>
<BR>
(<BR>
<BR>
IUnknown *pUnkOuter<BR>
<BR>
)<BR>
<BR>
: CInternetControl(pUnkOuter, OBJECT_TYPE_CTLBCFCONTROL, (IDispatch *)this)<BR>
<BR>
{<BR>
<BR>
// initialize anything here ...<BR>
<BR>
// <BR>
... <BR>
// set the ready state of the control<BR>
<BR>
m_state.lReadyState = READYSTATE_LOADING; <BR>
// NULL terminate the string reference<BR>
<BR>
m_lptstrTextDataPath = new TCHAR[1];<BR>
<BR>
m_lptstrTextDataPath[0] = `\0'; <BR>
} <BR>
#pragma warning(default:4355) // using `this' in constructor<BR>
</TT></FONT></P>
<P>Last you add your implementation of the <TT>ReadyState</TT> and <TT>TextDataPath</TT>
methods to your class source file (see Listing 11.8). You initiate the asynchronous
download of your data within your <TT>put_TextDataPath</TT> method. You do this through
a call to <TT>SetupDownload</TT>, where you pass in the path of the data to be downloaded
and the dispid of the property that the data is bound to. As data becomes available,
your <TT>OnData</TT> method is called.
<H3><A NAME="Heading11"></A>Listing 11.8 <SPACER TYPE="HORIZONTAL" SIZE="10">BCFCONTROLCTL.CPP--Property
Implementation</H3>
<P><FONT COLOR="#0066FF"><TT>STDMETHODIMP CBCFControlControl::get_ReadyState(long
* Value)<BR>
<BR>
{<BR>
<BR>
// make sure that we have a good pointer<BR>
<BR>
CHECK_POINTER(Value); <BR>
// set the return value<BR>
<BR>
*Value = m_state.lReadyState; <BR>
// return the result<BR>
<BR>
return S_OK;<BR>
<BR>
} <BR>
STDMETHODIMP CBCFControlControl::get_TextDataPath(BSTR FAR * bstrRetVal)<BR>
<BR>
{<BR>
<BR>
// if there is a string<BR>
<BR>
if(*bstrRetVal);<BR>
<BR>
{<BR>
<BR>
// free the string because we are going to replace it<BR>
<BR>
::SysFreeString(*bstrRetVal); <BR>
// clear the reference just to be safe<BR>
<BR>
*bstrRetVal = NULL;<BR>
<BR>
} <BR>
// return the caption as a BSTR<BR>
<BR>
*bstrRetVal = ::SysAllocString(OLESTRFROMANSI(m_lptstrTextDataPath)); <BR>
return S_OK;<BR>
<BR>
} <BR>
STDMETHODIMP CBCFControlControl::put_TextDataPath(BSTR bstrNewValue)<BR>
<BR>
{<BR>
<BR>
HRESULT hResult = S_OK; <BR>
// get a ANSI string from the BSTR<BR>
<BR>
MAKE_ANSIPTR_FROMWIDE(lpctstrTextDataPath, bstrNewValue); <BR>
// if we have a string<BR>
<BR>
if(lpctstrTextDataPath != NULL)<BR>
<BR>
{<BR>
<BR>
// if we have a string<BR>
<BR>
if(m_lptstrTextDataPath)<BR>
<BR>
{<BR>
<BR>
// delete the existing string<BR>
<BR>
delete [] m_lptstrTextDataPath; <BR>
// clear the reference just to be safe<BR>
<BR>
m_lptstrTextDataPath = NULL;<BR>
<BR>
} <BR>
// allocate a new string<BR>
<BR>
m_lptstrTextDataPath = new TCHAR[lstrlen(lpctstrTextDataPath) + 1]; <BR>
// assign the string to our member variable<BR>
<BR>
lstrcpy(m_lptstrTextDataPath, lpctstrTextDataPath);<BR>
<BR>
} <BR>
// start the asynchronous download of the data<BR>
<BR>
this-&gt;SetupDownload(OLESTRFROMANSI(m_lptstrTextDataPath), dispidTextDataPath);
<BR>
// let the container know that the property has changed<BR>
<BR>
m_fDirty = TRUE;<BR>
<BR>
// this-&gt;SetModifiedFlag(); &lt;== MFC version <BR>
return hResult; <BR>
}<BR>
</TT></FONT></P>
<P>Listing 11.9 shows your implementation of your <TT>OnData</TT> method, which will
progressively render the caption of your control from the <TT>IStream</TT> supplied.
It is possible to receive the <I>first </I>and<I> last</I> notification messages
within a single call to <TT>OnData</TT>, which is the reason for the separation between
the <TT>BSCF_FIRSTDATANOTIFICATION</TT> and <TT>BSCF_LASTDATANOTIFICATION</TT> messages.
Another flag that can be passed to the function is <TT>BSCF_INTERMEDIATEDATANTIFICATION</TT>,
which indicates that additional data is to be passed and that you have not received
it all. Your <TT>OnData</TT> function assumes that multiple calls to load data will
be made and checks for only the first and last notification messages.
<H3><A NAME="Heading12"></A>Listing 11.9<SPACER TYPE="HORIZONTAL" SIZE="10"> BCFCONTROLCTL.CPP--OnData
Implementation</H3>
<P><FONT COLOR="#0066FF"><TT>HRESULT CBCFControlControl::OnData(DISPID propId, DWORD
bscfFlag, IStream * strm, DWORD dwSize)<BR>
<BR>
{<BR>
<BR>
HRESULT hr = NOERROR; <BR>
// if this is the first notification<BR>
<BR>
if(bscfFlag &amp; BSCF_FIRSTDATANOTIFICATION)<BR>
<BR>
{<BR>
<BR>
// if we have a reference<BR>
<BR>
if(m_lptstrCaption)<BR>
<BR>
{<BR>
<BR>
// delete the string buffer<BR>
<BR>
delete [] m_lptstrCaption; <BR>
// clear the reference just to be safe<BR>
<BR>
m_lptstrCaption = NULL;<BR>
<BR>
}<BR>
<BR>
} <BR>
// alloc a temp buffer<BR>
<BR>
LPTSTR lptstrTempBuffer = new TCHAR[dwSize + 1];<BR>
<BR>
<BR>
<BR>
ULONG ulBytesRead;<BR>
<BR>
// read the data to a temp buffer<BR>
<BR>
hr = strm-&gt;Read(lptstrTempBuffer, dwSize, &amp;ulBytesRead); <BR>
// if we read in any data<BR>
<BR>
if(hr == S_OK &amp;&amp; ulBytesRead)<BR>
<BR>
{<BR>
<BR>
// null terminate the amount of data the was actually read in<BR>
<BR>
lptstrTempBuffer[ulBytesRead] = `\0'; <BR>
// get a new buffer with enough space to hold all of the data<BR>
<BR>
LPTSTR lptstrNewBuffer = new TCHAR[lstrlen(m_lptstrCaption) + ulBytesRead + 1]; <BR>
// copy the existing data to the new buffer<BR>
<BR>
lstrcpy(lptstrNewBuffer, m_lptstrCaption); <BR>
// add the new data to the buffer<BR>
<BR>
lstrcat(lptstrNewBuffer, lptstrTempBuffer); <BR>
// remove the existing string<BR>
<BR>
delete [] m_lptstrCaption; <BR>
// copy the data to the buffer<BR>
<BR>
m_lptstrCaption = lptstrNewBuffer; <BR>
// set the dirty flag<BR>
<BR>
m_fDirty = TRUE; <BR>
// redraw the control<BR>
<BR>
this-&gt;InvalidateControl(NULL);<BR>
<BR>
} <BR>
// if this is our last notification<BR>
<BR>
if(bscfFlag &amp; BSCF_LASTDATANOTIFICATION)<BR>
<BR>
{<BR>
<BR>
// set the ready state of the control<BR>
<BR>
m_state.lReadyState = READYSTATE_COMPLETE; <BR>
// set the dirty flag<BR>
<BR>
m_fDirty = TRUE;<BR>
<BR>
} <BR>
// return the result<BR>
<BR>
return(hr); <BR>
}<BR>
</TT></FONT></P>
<P>Potentially, any type of data can be rendered in this fashion. The BaseCtl framework
provides a sample implementation, called WebImage, that demonstrates the rendering
of bitmap data progressively as an asynchronous property.
<H3><A NAME="Heading13"></A>Static and Dynamic Property Enumeration</H3>
<P><I>Property enumeration</I> is a way of restricting a property to a specific set
of valid values. An example of an enumeration is a property for determining the alignment
of a control's displayed text: left-justified, centered, and right-justified, in
your case. Another case is a property used to select the different languages a control
supports. Language selection properties are good candidates for both a static set,
say for English and German, and a dynamic set, say for all the languages on a particular
machine.</P>
<P>As is pointed out in <A HREF="ch07.htm">Chapters 7</A> and <A HREF="ch09.htm">9</A>,
property enumeration adds, with very little effort, a new level of sophistication
to your control implementation. <BR>
<BR>
<B>Static Property Enumeration </B><SPACER TYPE="HORIZONTAL" SIZE="10">Static Property
Enumeration for a BaseCtl implemented control is no different than your MFC and ATL
implementations. Static enumeration is dependent on the ODL and requires no control
code to implement it. See <A HREF="ch07.htm">Chapter 7</A> for the implementation
details.</P>
<P><B>Dynamic Property Enumeration </B><SPACER TYPE="HORIZONTAL" SIZE="10">As with
your MFC and ATL implementations, adding Dynamic Property Enumeration to your BaseCtl
implementation is straightforward. Unfortunately, the BaseCtl does not provide the
basic OLE interface for Dynamic Property Enumeration support that you found in MFC,
so you must add it yourself. <I>Dynamic Property Enumeration</I> is based on the
interface <TT>IPerPropertyBrowsing</TT>. You will create a macro in a style similar
to that of the BaseCtl that will provide the necessary code to implement the interface.
Listing 11.10 shows the macro and the definition that you added. Essentially, the
macro is just a collection of functions that need to be supported in order to use
a specific interface. You are not required to implement the interface with a macro
as your are doing here. The macro just makes your control class code a little bit
easier to read and manage.
<H3><A NAME="Heading14"></A>Listing 11.10 <SPACER TYPE="HORIZONTAL" SIZE="10">IPERPROPERTYBROWSING.H--IPerPropertyBrowsing
Interface Macro</H3>
<P><FONT COLOR="#0066FF"><TT>#define DECLARE_STANDARD_PERPROPERTYBROWSING() \<BR>
<BR>
STDMETHOD(MapPropertyToPage)(DISPID Dispid, LPCLSID lpclsid); \<BR>
<BR>
STDMETHOD(GetPredefinedStrings)(DISPID Dispid, CALPOLESTR* lpcaStringsOut,\ <BR>
<BR>
CADWORD* lpcaCookiesOut); \<BR>
<BR>
STDMETHOD(GetPredefinedValue)(DISPID Dispid, DWORD dwCookie, VARIANT* lpvarOut);
\ <BR>
STDMETHOD(GetDisplayString)(DISPID Dispid, BSTR* lpbstr); \<BR>
</TT></FONT></P>
<P>In order for your control to support <TT>IPerPropertyBrowsing</TT>, you need to
include the header file for your <TT>IPerPropertyBrowsing</TT> macro, inherit from
the <TT>IPerPropertyBrowsing</TT> interface, and add the macro to your class declaration
(see Listing 11.11).
<H3><A NAME="Heading15"></A>Listing 11.11<SPACER TYPE="HORIZONTAL" SIZE="10"> BCFCONTROLCTL.H--IPerPropertyBrowsing
Interface Declaration</H3>
<P><FONT COLOR="#0066FF"><TT>#include &quot;Dispids.H&quot;<BR>
<BR>
#include &quot;internet.h&quot;<BR>
<BR>
#include &quot;IPerPropertyBrowsing.h&quot; <BR>
#include &quot;alignmentenums.h&quot; <BR>
typedef struct tagBCFCONTROLCTLSTATE<BR>
<BR>
{<BR>
<BR>
long lCaptionLength;<BR>
<BR>
long lAlignment;<BR>
<BR>
OLE_COLOR ocBackColor;<BR>
<BR>
long lReadyState;<BR>
<BR>
long lTextDataPathLength;<BR>
<BR>
} BCFCONTROLCTLSTATE; <BR>
//=-------------------------------------------------------------------------=<BR>
<BR>
// CBCFControlControl<BR>
<BR>
//=-------------------------------------------------------------------------=<BR>
<BR>
// our control.<BR>
<BR>
//<BR>
<BR>
class CBCFControlControl : public CInternetControl, public IBCFControl, <BR>
<BR>
public ISupportErrorInfo, public IPerPropertyBrowsing<BR>
<BR>
{<BR>
<BR>
public:<BR>
<BR>
// IUnknown methods<BR>
<BR>
//<BR>
<BR>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色94色欧美sute亚洲13| 视频在线观看91| 精品国产青草久久久久福利| 欧美一区二区三区公司| 欧美日韩久久不卡| 久久久久久久久久久电影| 欧美亚洲图片小说| 欧美日本在线一区| 欧美性大战久久久久久久| 亚洲自拍偷拍综合| 69成人精品免费视频| 国产一区二区女| 国产精品超碰97尤物18| 91在线云播放| 欧美高清视频在线高清观看mv色露露十八 | 日本伊人午夜精品| 久久黄色级2电影| 岛国一区二区在线观看| 337p亚洲精品色噜噜噜| 国产精品久久毛片av大全日韩| 6080yy午夜一二三区久久| 日韩免费在线观看| 国产精品视频观看| 日韩高清不卡一区| 欧美日韩黄色影视| 久久久久久麻豆| 午夜精品福利一区二区三区av| 色婷婷精品久久二区二区蜜臂av | 欧美一区二区三区的| 麻豆91精品视频| 国产精品嫩草久久久久| 一本久道中文字幕精品亚洲嫩| 亚洲欧美国产高清| 2022国产精品视频| 91原创在线视频| 亚洲高清免费视频| 欧美一区二区三区视频免费| 精品一区在线看| 久久九九久精品国产免费直播| 日本亚洲一区二区| 欧美老肥妇做.爰bbww视频| 一区二区欧美精品| 白白色亚洲国产精品| 久久久激情视频| 欧美午夜视频网站| 一区二区三区四区在线播放| 亚洲品质自拍视频网站| 国产无一区二区| 欧美日韩国产影片| 波多野结衣中文一区| 激情图区综合网| 日韩主播视频在线| 亚洲电影第三页| 亚洲色图清纯唯美| 国产精品日韩成人| 久久精品日产第一区二区三区高清版| 欧美一二三四区在线| 欧美色男人天堂| 91国产精品成人| 色综合一个色综合| 成人午夜激情在线| 国产不卡在线一区| 国产精品一二三区| 精品亚洲成a人| 亚洲国产综合91精品麻豆| 亚洲成人在线网站| 欧美久久久影院| 青草av.久久免费一区| 精品国产百合女同互慰| bt7086福利一区国产| 亚洲一区二区五区| 久久久久久久性| 欧美日韩三级视频| 日日摸夜夜添夜夜添亚洲女人| 精品国产乱码久久| 欧美va亚洲va国产综合| 日韩美女视频一区二区在线观看| 日本一区二区三区电影| 日韩一区二区精品在线观看| www.亚洲色图.com| 久久精品国产精品亚洲红杏| 夜夜嗨av一区二区三区网页| 国产欧美精品一区二区色综合| 69p69国产精品| 91在线你懂得| 国产电影一区二区三区| 麻豆成人91精品二区三区| 亚洲综合免费观看高清完整版 | 国产在线精品一区二区夜色| 亚洲精品乱码久久久久| 欧美一个色资源| 久久国产精品无码网站| 亚洲精品成人少妇| 亚洲免费观看高清完整| 一区二区三区在线播放| 色噜噜狠狠一区二区三区果冻| 久久久久国产免费免费| 91免费看`日韩一区二区| 99re8在线精品视频免费播放| 91农村精品一区二区在线| 亚洲蜜臀av乱码久久精品| 国产精品美日韩| 亚洲精品国产一区二区精华液| 亚洲成a人v欧美综合天堂下载| 日韩va欧美va亚洲va久久| 麻豆91精品视频| 久久99在线观看| 国产一区二区三区在线观看免费视频| 激情小说亚洲一区| 99re成人在线| 欧美亚一区二区| 91精品久久久久久久99蜜桃| 日韩免费高清电影| 久久久国产午夜精品| 久久精品欧美一区二区三区不卡| 日韩激情av在线| 国产精品久久久久影院亚瑟| 久久久av毛片精品| 日韩女优av电影| 日韩精品国产精品| 欧美精品九九99久久| 欧美疯狂性受xxxxx喷水图片| 中文乱码免费一区二区| 久久久久久97三级| 国产精品蜜臀av| 风间由美一区二区三区在线观看| 欧美大尺度电影在线| 国产亚洲欧美一区在线观看| 亚洲在线成人精品| 国产麻豆91精品| 欧美高清性hdvideosex| 自拍偷拍亚洲激情| 国产精品系列在线播放| 91精品国产色综合久久不卡电影| 懂色av一区二区三区免费看| 国产日本一区二区| 午夜视频久久久久久| 成人黄色国产精品网站大全在线免费观看| 欧美日韩一二三区| 亚洲欧美一区二区在线观看| 国产一区二区调教| 91精品啪在线观看国产60岁| 一区二区三区在线免费| 成人综合婷婷国产精品久久蜜臀 | 中文字幕av一区二区三区| 国产精品视频麻豆| 日韩欧美国产一二三区| 精品久久久久久综合日本欧美| 色婷婷久久99综合精品jk白丝| 久久久五月婷婷| 蜜桃久久av一区| 日韩精品一区二区在线| 久久国产婷婷国产香蕉| 日韩一区二区三区四区五区六区| 男人的天堂亚洲一区| 91精品国产欧美一区二区| 国产在线一区观看| 中文字幕一区av| 欧美性生活一区| 日本成人中文字幕在线视频| 精品国产区一区| 国产91露脸合集magnet| 亚洲精品中文字幕在线观看| 91福利小视频| 国产麻豆精品久久一二三| 国产精品午夜电影| 欧美mv日韩mv亚洲| 99re66热这里只有精品3直播| 国产精品小仙女| 欧美成人国产一区二区| 青娱乐精品视频| 精品少妇一区二区三区免费观看| 麻豆国产精品官网| 亚洲欧洲av一区二区三区久久| 91麻豆视频网站| 日韩三级在线观看| 亚洲视频1区2区| 一区二区高清免费观看影视大全| 亚洲一区二区中文在线| 欧美日本在线一区| 久久国产精品无码网站| 久久色在线观看| 高清久久久久久| 亚洲精品高清在线| 欧美色视频在线观看| 亚洲国产日韩一区二区| 91久久香蕉国产日韩欧美9色| 一区视频在线播放| 成人免费毛片片v| 国产成人av电影在线播放| 日韩经典中文字幕一区| 亚洲裸体xxx| 中文字幕一区二区不卡| 亚洲第一久久影院| 精品婷婷伊人一区三区三| 99精品欧美一区| 欧美肥大bbwbbw高潮| 97se亚洲国产综合自在线观| 99精品视频一区二区| 91香蕉视频黄|