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

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

?? ch03.htm

?? 用vc開發activex
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
<BR>
// set the source file <BR>
pOleDispExcep-&gt;m_strSource = __FILE__; <BR>
// format the error description <BR>
pOleDispExcep-&gt;m_strDescription = _T(&quot;Unable to retrieve the lower bound
dimension of the array.&quot;); <BR>
// the function call failed cause an ole exception <BR>
throw(pOleDispExcep); <BR>
} <BR>
// unlock the array we don't need it anymore <BR>
::SafeArrayUnlock(varOutputArray-&gt;parray); <BR>
} <BR>
else <BR>
{ <BR>
bResult = VARIANT_FALSE; <BR>
// unable to get a record based on the sql statement - throw an exception <BR>
COleDispatchException * pOleDispExcep = new COleDispatchException(_T(&quot;&quot;),
NULL, 0); <BR>
// format the error code <BR>
pOleDispExcep-&gt;m_scError = MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, MFCSERVER_E_NO_ARRAYLOCK);
<BR>
// set the source file <BR>
pOleDispExcep-&gt;m_strSource = __FILE__; <BR>
// format the error description <BR>
pOleDispExcep-&gt;m_strDescription = _T(&quot;Unable to lock the array memory.&quot;);
<BR>
// the function call failed cause an ole exception <BR>
throw(pOleDispExcep); <BR>
} <BR>
} <BR>
else <BR>
{ <BR>
bResult = VARIANT_FALSE; <BR>
// unable to get a record based on the sql statement - throw an exception <BR>
COleDispatchException * pOleDispExcep = new COleDispatchException(_T(&quot;&quot;),
NULL, 0); <BR>
// if we didn't have a file handle <BR>
if(!m_fileLog) <BR>
// format the error code <BR>
pOleDispExcep-&gt;m_scError = MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, MFCSERVER_E_NO_FILE);
<BR>
else <BR>
// format the error code <BR>
pOleDispExcep-&gt;m_scError = MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, MFCSERVER_E_BAD_ARRAY_PARAMETER);
<BR>
// set the source file <BR>
pOleDispExcep-&gt;m_strSource = __FILE__; <BR>
// if we didn't have a file handle <BR>
if(!m_fileLog) <BR>
// format the error description <BR>
pOleDispExcep-&gt;m_strDescription = _T(&quot;Invalid File Handle. File could not
be opened for output.&quot;); <BR>
else <BR>
// format the error description <BR>
pOleDispExcep-&gt;m_strDescription = _T(&quot;The first parameter must be a string
array passed by reference.&quot;); <BR>
// the function call failed cause an ole exception <BR>
throw(pOleDispExcep); <BR>
} <BR>
// return the result <BR>
return bResult; <BR>
} <BR>
long CTracker::GetIndent() <BR>
{ <BR>
// return the member variable <BR>
return m_lIndent; <BR>
} <BR>
void CTracker::SetIndent(long nNewValue) <BR>
{ <BR>
// if the new value is a least 0 <BR>
if(nNewValue &gt;= 0) <BR>
// assign the value to our member variable <BR>
m_lIndent = nNewValue; <BR>
else <BR>
{ <BR>
// unable to get a record based on the sql statement - throw an exception <BR>
COleDispatchException * pOleDispExcep = new <BR>
<BR>
<BR>
<BR>
COleDispatchException(_T(&quot;&quot;), NULL, 0); <BR>
// format the error code <BR>
pOleDispExcep-&gt;m_scError = MAKE_SCODE(SEVERITY_ERROR, FACILITY_ITF, MFCSERVER_E_INVALID_VALUE);
<BR>
// set the source file <BR>
pOleDispExcep-&gt;m_strSource = __FILE__; <BR>
// format the error description <BR>
pOleDispExcep-&gt;m_strDescription = _T(&quot;Invalid value. Value must be 0 or greater.&quot;);
<BR>
// the function call failed cause an ole exception <BR>
throw(pOleDispExcep); <BR>
} <BR>
<BR>
} </TT></FONT></P>
<P>Exceptions are useful for communicating error conditions and problems back to
the application and developer who are using an ActiveX component. Make use of them
whenever you can to further enhance your implementation.
<H2><A NAME="Heading24"></A>Dual-Interface</H2>
<P>Dual-interface is exactly what it sounds like: The server implementation supports
two interfaces with which to talk to the server. One interface, an IDispatch<I> interface,</I>
is what you have been working with so far. The other, a <I>custom interface, </I>is
a type of interface that you have not looked at yet. The dual portion refers to the
fact that no matter which interface you choose, you are always talking to the same
server, and you will always get the same response.</P>
<P>An <TT>IDispatch</TT>-based interface uses a generic mechanism for calling methods
and properties in a server. When a method in a server is called, you pass the ID
of the method to invoke and a structure describing its parameters and return type.
This data is packaged and sent to the server, which unpackages the data and calls
the appropriate method based on the ID supplied.</P>
<P>A custom interface, on the other hand, is very different. When using a custom
interface, you are talking directly to the server's functions and are not depending
on a generic mechanism for invoking the methods or properties. The packaging of the
parameters and return value are left to the compiler that created the applications.</P>
<P>Since the interfaces are written to access the same set of functions, the custom
interface portion of a dual-interface server must conform to the same data type restrictions
imposed by Automation. This way, you are not required to create your own code to
transfer data between the two applications: the controller and the server. OLE does
that for you with standard marshaling.</P>
<P>The major advantage to dual-interface is performance. The number of steps to call
a method using the custom interface is far less than the number needed to call a
method when using the <TT>IDispatch</TT> interface.</P>
<P>The main disadvantage to dual-interface support in MFC servers is that they are
not supported by the ClassWizard and will require manual changes to implement. The
code involved is not too difficult to maintain; the hardest part is probably remembering
to do it. <BR>
<BR>
<IMG SRC="bar.gif" WIDTH="480" HEIGHT="6" ALIGN="BOTTOM" BORDER="0"></P>


<BLOCKQUOTE>
	<P><B>NOTE:</B> The advantage of using the custom interface of a dual-interface server
	loses its luster when executing across process boundaries. The custom interface is
	still faster, but not by much. The real performance benefit, a 25 to 50 percent improvement,
	is when the server is in-process to the calling application. The amount of improvement
	depends on the number and types of parameters that are being passed between the applications.
	If you are interested in seeing actual numbers regarding the amount of performance
	improvement, you can refer to recent Microsoft Systems Journal articles, which have
	focused on performance differences between <TT>IDispatch</TT> and custom interfaces.

</BLOCKQUOTE>

<P><IMG SRC="bar.gif" WIDTH="480" HEIGHT="6" ALIGN="BOTTOM" BORDER="0"><BR>
<BR>
The first step when converting an MFC-based ActiveX server to dual-interface is to
change the ODL file. Listing 3.14 shows the changes that have been made to the server
to support dual-interface. It is not necessary to generate new <TT>UUID</TT>s because
the functionality of the server has not changed. You must add the <TT>oleautomation</TT>
and <TT>dual</TT> attributes to the interface class, though. You also add the <TT>hidden</TT>
attribute, so this interface will not be visible within VB. This is fine since VB
will display the <TT>CoClass</TT> interface and will also show all of the methods
and properties for the server. As a general rule, you should always hide your interfaces
and leave visible the <TT>CoClasses</TT> used to create them. This is because applications
like VB will display both interfaces, and the reality is that only the <TT>CoClass</TT>
name is valid in VB; if you try to reference an object by its interface name, you
will get an error.</P>
<P>Since the server supports dual-interface, you must change your interface declaration
to inherit from the <TT>IDispatch</TT> interface rather than declare the interface
as type <TT>dispinterface</TT>, as in the original implementation. Dual-interface
method and property declarations are different from <TT>dispinterface</TT> declarations,
which are more like standard C++. Note that keywords such as <TT>method</TT> and
<TT>properties</TT> are no longer within the interface declaration. Those terms are
keywords related to the <TT>dispinterface</TT> keyword. As we stated earlier, properties
are accessed using a pair of methods sharing the same dispid. The distinguishing
factors are the method attributes <TT>propget</TT> and <TT>propput,</TT> which denote
the direction of data flow. You must also change the <TT>CoClass</TT> to refer to
interface and not <TT>dispinterface</TT>.</P>
<P>All dual-interface methods must return an <TT>HRESULT</TT> data type. If a method
requires a return value, it must be specified as the last parameter of the method
and must have the parameter attributes of <TT>out</TT> and <TT>retval</TT>. All parameters
must have an attribute describing the direction of data flow. See Table 3.3 for a
complete description of the possible attributes and combinations. 
<TABLE BORDER="1" WIDTH="100%">
	<CAPTION><B>Table 3.3</B><SPACER TYPE="HORIZONTAL" SIZE="10"><B> Parameter Flow Attributes</B></CAPTION>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP"><B>Direction</B></TD>
		<TD ALIGN="LEFT" VALIGN="TOP"><B>Description</B></TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP"><TT>in</TT></TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Parameter is passed from caller to callee.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP"><TT>out</TT></TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Parameter is returned from callee to caller.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP"><TT>in</TT>, <TT>out</TT></TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Parameter is passed from caller to callee, and the callee returns a parameter.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP"><TT>out</TT>, <TT>retval</TT></TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Parameter is the return value of the method and is returned from the callee to the
			caller.</TD>
	</TR>
</TABLE>

<H3><A NAME="Heading25"></A>Listing 3.14 MFCSERVER.ODL--ODL Changes to Support Dual-Interface</H3>
<P><FONT COLOR="#0066FF"><TT>[ uuid(11C82943-4EDD-11D0-BED8-00400538977D), version(1.0)
] <BR>
library MFCServer <BR>
{ <BR>
importlib(&quot;stdole32.tlb&quot;); <BR>
<BR>
[ uuid(11C82946-4EDD-11D0-BED8-00400538977D), oleautomation, dual, hidden ] <BR>
interface ITracker: IDispatch <BR>
{ <BR>
[id(1), propget] HRESULT Indent([out, retval] long * Value); <BR>
[id(1), propput] HRESULT Indent([in] long Value); <BR>
[id(2)] HRESULT OutputLines([in] VARIANT * varOutputArray, [in, optional] VARIANT
varIndent, [out, retval] boolean * RetVal); <BR>
}; <BR>
// CoClass for CTracker <BR>
[ uuid(11C82947-4EDD-11D0-BED8-00400538977D) ] <BR>
coclass TRACKER <BR>
{ <BR>
[default] interface ITracker; <BR>
}; <BR>
typedef [uuid(11C82948-4EDD-11D0-BED8-00400538977D), helpstring(&quot;Tracker Error
Constants&quot;)] <BR>
#include &quot;trackererror.h&quot; <BR>
//{{AFX_APPEND_ODL}} <BR>
<BR>
}; </TT></FONT></P>
<P>The remainder of the ODL file entries do not have to be changed to support dual-interface.
<BR>
<BR>
<IMG SRC="bar.gif" WIDTH="480" HEIGHT="6" ALIGN="BOTTOM" BORDER="0"></P>


<BLOCKQUOTE>
	<P><B>NOTE:</B> The changes that have been made to the ODL file will prevent the
	ClassWizard from updating the ODL file automatically when new methods and properties
	are added. You are now responsible for maintaining the entries manually.

</BLOCKQUOTE>

<P><IMG SRC="bar.gif" WIDTH="480" HEIGHT="6" ALIGN="BOTTOM" BORDER="0"><BR>
<BR>
The ODL compiler has the capability of generating a C++ header file that describes
all of the interfaces and enumerations that are contained in the type library that
you've created for your server. The ODL-generated header file is useful for creating
function prototypes that are required in the implementation of the server. You add
the entry to the ODL file and compile it into a type library. Next copy the new method
from the header file into your class definition and make some minor changes--and
everything is finished. In addition, you now have an interface file that can be used
by other applications to access the custom interface of your server as well as t

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产99一区视频免费| 亚洲女性喷水在线观看一区| 欧美国产精品一区| 亚洲精品ww久久久久久p站| 日本伊人色综合网| 国产自产v一区二区三区c| 97久久精品人人做人人爽| 在线播放日韩导航| 国产色一区二区| 午夜免费久久看| 丁香激情综合国产| 欧美日韩亚洲综合一区二区三区| 精品91自产拍在线观看一区| 亚洲另类一区二区| 国产一区不卡视频| 在线电影欧美成精品| 日韩一区日韩二区| 久久91精品国产91久久小草| 色菇凉天天综合网| 国产亚洲欧美色| 五月婷婷综合网| av激情综合网| 久久久综合视频| 三级欧美韩日大片在线看| a4yy欧美一区二区三区| 久久综合资源网| 亚洲国产精品天堂| 成人网在线免费视频| 日韩一区二区精品| 亚洲国产欧美日韩另类综合| 国产999精品久久久久久绿帽| 欧美一区二区啪啪| 亚洲卡通动漫在线| 成人午夜视频免费看| 欧美一区二区三区日韩| 亚洲柠檬福利资源导航| 从欧美一区二区三区| 日韩三级伦理片妻子的秘密按摩| 亚洲最新视频在线播放| 成人亚洲一区二区一| 欧美电影免费观看高清完整版在线| 一区二区视频免费在线观看| 不卡视频一二三| 26uuu色噜噜精品一区二区| 日韩精品乱码免费| 欧美日韩久久一区二区| 亚洲激情av在线| 91免费版在线| 亚洲国产精品99久久久久久久久| 韩国成人在线视频| 日韩欧美区一区二| 日本成人在线网站| 欧美丝袜丝nylons| 亚洲黄色性网站| 91视频com| 国产精品久久久久精k8 | 6080亚洲精品一区二区| 亚洲精品乱码久久久久久久久| 成人午夜视频在线观看| 欧美国产视频在线| 国产不卡免费视频| 国产欧美一区二区精品婷婷| 国产一区二区三区久久久| 精品国产乱码久久久久久影片| 免费成人在线观看| 日韩欧美亚洲一区二区| 蜜桃视频在线一区| 欧美一区二区三区免费大片| 日韩国产欧美在线观看| 91精品国产综合久久久久久漫画 | 日韩天堂在线观看| 日日摸夜夜添夜夜添国产精品| 欧美日韩成人在线一区| 婷婷一区二区三区| 欧美一级欧美一级在线播放| 日本va欧美va欧美va精品| 日韩免费一区二区三区在线播放| 麻豆国产精品官网| 26uuu色噜噜精品一区二区| 国产成人免费av在线| 日本一区二区三区免费乱视频| 国产精品羞羞答答xxdd| 国产精品美女久久久久久2018| 9久草视频在线视频精品| 亚洲美女视频在线观看| 日本道色综合久久| 午夜欧美大尺度福利影院在线看| 69成人精品免费视频| 狠狠色丁香婷婷综合| 久久亚洲捆绑美女| 99精品久久久久久| 亚洲高清免费视频| 日韩一级片网址| 高清久久久久久| 亚洲视频免费在线观看| 欧美视频一区在线| 精油按摩中文字幕久久| 国产精品天美传媒沈樵| 欧美性受极品xxxx喷水| 男人操女人的视频在线观看欧美| 精品盗摄一区二区三区| 成人a免费在线看| 一片黄亚洲嫩模| 精品伦理精品一区| 99视频热这里只有精品免费| 亚洲自拍偷拍综合| 精品成人在线观看| 99精品久久只有精品| 日韩电影在线观看一区| 久久精品欧美日韩精品| 欧美色精品在线视频| 激情六月婷婷久久| 亚洲精品国产一区二区三区四区在线 | 欧美本精品男人aⅴ天堂| 不卡视频一二三| 日本欧美大码aⅴ在线播放| 欧美国产精品一区| 精品视频色一区| 国产99精品国产| 三级久久三级久久久| 中文子幕无线码一区tr| 91麻豆精品国产91久久久久久| 东方欧美亚洲色图在线| 香蕉av福利精品导航| 日本一区二区动态图| 56国语精品自产拍在线观看| yourporn久久国产精品| 狂野欧美性猛交blacked| 亚洲精品久久7777| 国产亚洲精品超碰| 欧美丰满少妇xxxbbb| 成人做爰69片免费看网站| 日韩成人av影视| 亚洲欧美色图小说| 久久亚洲精品国产精品紫薇| 欧美日韩国产精选| 91在线观看地址| 国产高清不卡二三区| 日本不卡123| 亚洲综合色婷婷| 中文字幕在线一区二区三区| 日韩欧美久久久| 欧美日韩久久一区二区| 99re这里只有精品首页| 国产麻豆精品在线| 日日噜噜夜夜狠狠视频欧美人 | 欧美三级日本三级少妇99| 成人性生交大片免费看中文| 精品一区二区三区的国产在线播放| 亚洲在线成人精品| 日韩毛片一二三区| 国产视频在线观看一区二区三区| 日韩女优毛片在线| 欧美日韩国产片| 色94色欧美sute亚洲13| 成人午夜伦理影院| 国产精品一区二区久久不卡| 久久成人18免费观看| 日韩二区三区在线观看| 亚洲狠狠爱一区二区三区| 亚洲欧美一区二区三区国产精品 | 色素色在线综合| av成人免费在线| 成人黄色大片在线观看| 国产99久久久国产精品潘金 | 亚洲丝袜另类动漫二区| 中文在线一区二区| 欧美激情综合网| 国产视频不卡一区| 国产日产欧产精品推荐色| 精品国产123| 久久综合九色综合97婷婷女人 | 成人一区二区三区在线观看| 久久国产剧场电影| 另类小说视频一区二区| 麻豆91精品视频| 美女网站视频久久| 免费av网站大全久久| 免费久久99精品国产| 久久不见久久见免费视频7 | 国产亚洲综合在线| 国产亚洲成av人在线观看导航| 国产区在线观看成人精品| 久久精品视频网| 亚洲国产经典视频| 最新不卡av在线| 亚洲精品福利视频网站| 亚洲午夜电影网| 天天综合色天天| 久久se精品一区二区| 国产经典欧美精品| 国产成人精品免费看| 99热这里都是精品| 欧美视频一区二区三区| 欧美精选午夜久久久乱码6080| 欧美日本免费一区二区三区| 欧美一级午夜免费电影| 欧美成人精精品一区二区频| 国产偷国产偷精品高清尤物 | 欧美日韩aaaaaa|