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

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

?? ch04.htm

?? 用vc開發(fā)activex
?? HTM
?? 第 1 頁 / 共 5 頁
字號(hào):
continue. <A HREF="Art/04/dfig04.jpg"><B><BR>
<BR>
FIG. 4.4</B></A> <I><BR>
Select the type of ATL object to add to your project.</I></P>
<P>The next dialog is the ATL Object Wizard Properties dialog, which is used to define
the specific properties of the new object that will be added to your project. Select
the Names tab (see fig. 4.5), and in the <U>S</U>hort Name edit field, type Tracker;
the remainder of the edit fields will automatically update, reflecting the short
name that you added. The other fields can be changed, but in this case, you will
use the default values.<BR>
<BR>
 <A HREF="Art/04/dfig05.jpg"><B>FIG. 4.5</B></A> <I><BR>
Define the name of the new control object.</I></P>
<P>Select the Attributes tab so that you can define the attributes of the server
object (see fig. 4.6). Check the Support <U>I</U>SupportErrorInfo check box to add
OLE rich error. You can add events to the ATL object by checking the Support Connection
Points check box; however, for the purposes of the sample, you will not. Leave the
remainder of the settings on the Attributes tab at their default values. Click OK
to continue and to add the object to the project. <A HREF="Art/04/dfig06.jpg"><B><BR>
<BR>
FIG. 4.6</B></A> <I><BR>
Define the attributes of the new server object.</I></P>
<P><A HREF="ch08.htm">Chapters 8</A> and <A HREF="ch09.htm">9</A> go into detail
about adding events to an ATL control; the same process is used for an ATL server.
At the time this book was being written, one drawback to having events was that only
VB5 was built to take advantage of them.</P>
<P>The ATL ObjectWizard added the files, Tracker.h, Tracker.cpp, and Tracker.rgs
to the project. Tracker.h and Tracker.cpp are the implementation files for your server
object. Tracker.rgs is the registry script file that is used to register your server
in the registration database. You will learn more about the Tracker.rgs file in the
section regarding server registration a little later in this chapter.</P>
<P>Before continuing with your server implementation, your newly created IDL file
deserves a quick review. Listing 4.1 shows the basic IDL file that is generated by
the AppWizard. <BR>
<BR>
<IMG SRC="bar.gif" WIDTH="480" HEIGHT="6" ALIGN="BOTTOM" BORDER="0"></P>


<BLOCKQUOTE>
	<P><B>TIP:</B> For clarity, you should add the <TT>hidden</TT> attribute to the <TT>IDispatch</TT>-based
	interfaces defined in the server (see Listing 4.1). This step prevents tools like
	VB from displaying both the <TT>IDispatch</TT> interface and its related <TT>CoClass</TT>
	within the VB Object browser. The <TT>CoClass</TT> is the only interface that needs
	to be visible since it is the only interface that VB uses. Using the <TT>IDispatch</TT>
	interface in VB will result in errors.

</BLOCKQUOTE>

<P><IMG SRC="bar.gif" WIDTH="480" HEIGHT="6" ALIGN="BOTTOM" BORDER="0"> <BR>
<BR>
The most obvious difference between the ODL from the MFC sample and the IDL of this
sample is the location of the <TT>IDispatch</TT> interface relative to the rest of
the <I>type library</I> description. When using IDL, you must declare the interfaces
that will generate the C++ source files outside of the library declaration. For the
ODL, this step is not necessary. Other than a few minor language differences, the
IDL and ODL are identical in terms of syntax and organization.
<H3><A NAME="Heading4"></A>Listing 4.1 ATLSERVER.IDL--IDL File for the ATL Server
Sample</H3>
<P><FONT COLOR="#0066FF"><TT>import &quot;oaidl.idl&quot;; <BR>
// ATLServer.idl : IDL source for ATLServer.dll <BR>
// // This file will be processed by the MIDL tool to <BR>
// produce the type library (ATLServer.tlb) and marshalling code. [ <BR>
object, <BR>
uuid(03699612-809E-11D0-BEFF-00400538977D), <BR>
dual, <BR>
helpstring(&quot;ITracker Interface&quot;), <BR>
pointer_default(unique), <BR>
hidden <BR>
] <BR>
interface ITracker : IDispatch <BR>
{ <BR>
}; <BR>
[ <BR>
uuid(03699601-809E-11D0-BEFF-00400538977D), <BR>
version(1.0), <BR>
helpstring(&quot;ATLServer 1.0 Type Library&quot;) <BR>
] <BR>
library ATLSERVERLib <BR>
{ <BR>
importlib(&quot;stdole32.tlb&quot;); [ <BR>
uuid(03699613-809E-11D0-BEFF-00400538977D), <BR>
helpstring(&quot;Tracker Class&quot;) <BR>
] <BR>
coclass Tracker <BR>
{ <BR>
[default] interface ITracker; <BR>
}; }; </TT></FONT></P>
<P>Before another application can use the server, however, OLE has to know where
to find the server, which is done through the system registry. All ActiveX components
that are publicly available to other applications must support registration and must
create valid registry entries.
<H2><A NAME="Heading5"></A>Registry</H2>
<P>ActiveX components have one or more registry entries that are used to describe
various aspects of the application and how it can be used. The registry is critical
to the successful launching and using of ActiveX components.</P>
<P>All inproc ActiveX components expose registration support via two exported functions:
<TT>DllRegisterServer</TT> and <TT>DllUnregisterServer</TT>. For information regarding
the registration of local servers, see <A HREF="ch03.htm">Chapter 3</A>.</P>
<P>The basic registration and unregistration support for the server is already implemented
by ATL. You are not required to make code changes or additions to support it. Remember
that the MFC implementation allows only for registering the server and does not support
unregistration.</P>
<P>Unlike MFC which uses a set of constants, ATL relies on resource information in
the form of a registry script file to define the information that is added to the
registry database. The registry script file is added automatically to the project
when the server object is added; there is one script file for each server object.</P>
<P>The registry script file(s) are compiled into the server project as resources
and can be viewed in binary form in the resource editor. The files, which have the
extension .rgs, are normal text files that can be edited within the IDE. For more
information about the use of registry script files and their particular syntax, see
the VC++ books online subject &quot;Registry Scripting Examples--ActiveX Template
Library, Articles.&quot; Listing 4.2 shows the registry script file for the <TT>CTracker</TT>
server object that you added.
<H3><A NAME="Heading6"></A>Listing 4.2 ATLCONTROLWIN.RGS--Sample Registry Script
File for the CTracker Server Object<FONT COLOR="#0066FF"><TT></TT></FONT></H3>
<P><FONT COLOR="#0066FF"><TT>HKCR <BR>
{ <BR>
Tracker.Tracker.1 = s `Tracker Class' <BR>
{ <BR>
CLSID = s `{03699613-809E-11D0-BEFF-00400538977D}' <BR>
} <BR>
Tracker.Tracker = s `Tracker Class' <BR>
{ <BR>
CurVer = s `Tracker.Tracker.1' <BR>
} <BR>
NoRemove CLSID <BR>
{ <BR>
ForceRemove {03699613-809E-11D0-BEFF-00400538977D} = s `Tracker Class' <BR>
{ <BR>
ProgID = s `Tracker.Tracker.1' <BR>
VersionIndependentProgID = s `Tracker.Tracker' <BR>
ForceRemove `Programmable' <BR>
LocalServer32 = s `%MODULE%' <BR>
} <BR>
} <BR>
} </TT></FONT></P>

<P><IMG SRC="bar.gif" WIDTH="480" HEIGHT="6" ALIGN="BOTTOM" BORDER="0"></P>


<BLOCKQUOTE>
	<P><B>NOTE:</B> Unfortunately, at the time of the writing of this book, the ATL ClassWizard
	created the Tracker.rgs file incorrectly. Hopefully, this problem will be fixed by
	the time the product is released. Listing 4.3 shows the updated version of the Tracker.rgs
	file with the mistakes corrected. The first correction was to change the <TT>ProgID</TT>
	to <TT>ATLServer.Tracker</TT>, reflecting the parent module and the subordinate object.
	The next correction was to add the <TT>CLSID</TT> entry to the version- independent
	<TT>ProgID</TT> section. This may have been intentional on the part of the ATL team.
	The last and definitely most significant problem was the fact that the <TT>CLSID</TT>
	section listed the server as <TT>LocalServer32</TT> and not <TT>InprocServer32</TT>.
	After making the corrections, the server registered and ran as expected.

</BLOCKQUOTE>

<P><IMG SRC="bar.gif" WIDTH="480" HEIGHT="6" ALIGN="BOTTOM" BORDER="0">
<H3><A NAME="Heading8"></A>Listing 4.3 TRACKER.RGS--Updated Tracker.rgs File</H3>
<P><FONT COLOR="#0066FF"><TT>HKCR <BR>
{ <BR>
ATLServer.Tracker.1 = s `Tracker Class' <BR>
{ <BR>
CLSID = s `{03699613-809E-11D0-BEFF-00400538977D}' <BR>
} <BR>
ATLServer.Tracker = s `Tracker Class' <BR>
{ <BR>
CLSID = s `{03699613-809E-11D0-BEFF-00400538977D}' <BR>
CurVer = s `ATLServer.Tracker.1' <BR>
} <BR>
NoRemove CLSID <BR>
{ <BR>
ForceRemove {03699613-809E-11D0-BEFF-00400538977D} = s `Tracker <BR>
{ <BR>
ProgID = s `ATLServer.Tracker.1' <BR>
VersionIndependentProgID = s `ATLServer.Tracker' <BR>
ForceRemove `Programmable' <BR>
InprocServer32 = s `%MODULE%' <BR>
} <BR>
} } </TT></FONT></P>
<H2><A NAME="Heading9"></A>Sample Server Support Code</H2>
<P>Since the server is used to output data to a file, you first need to add some
support code to the application before adding its methods and properties.</P>
<P>Listing 4.4 shows the changes and additions that need to be made to the class
header file. First add a destructor to the class and remove the constructor implementation--you
will add it to the source file later. Then add a set of member variables for storing
the file handle and timer information that will be used throughout the server implementation.
<H3><A NAME="Heading10"></A>Listing 4.4 Tracker.H--Sample Server Support Code Added
to the Tracker Header File</H3>
<P><FONT COLOR="#0066FF"><TT>/////////////////////////////////////////////////////////////////////////////
<BR>
// CTracker <BR>
class ATL_NO_VTABLE CTracker : <BR>
public CComObjectRootEx&lt;CComObjectThreadModel&gt;, <BR>
public CComCoClass&lt;CTracker, &amp;CLSID_Tracker&gt;, <BR>
public ISupportErrorInfo, <BR>
public IDispatchImpl&lt;ITracker, &amp;IID_ITracker, &amp;LIBID_ATLSERVERLib&gt;
<BR>
{ <BR>
public: <BR>
// constructor <BR>
CTracker(); <BR>
// destructor <BR>
~CTracker(); DECLARE_REGISTRY_RESOURCEID(IDR_TRACKER) BEGIN_COM_MAP(CTracker) <BR>
COM_INTERFACE_ENTRY(ITracker) <BR>
COM_INTERFACE_ENTRY(IDispatch) <BR>
COM_INTERFACE_ENTRY(ISupportErrorInfo) <BR>
END_COM_MAP() // ISupportsErrorInfo <BR>
STDMETHOD(InterfaceSupportsErrorInfo)(REFIID riid); // ITracker <BR>
public: protected: <BR>
FILE * m_fileLog; <BR>
long m_lTimeBegin; <BR>
long m_lHiResTime; <BR>
long m_lLastHiResTime; }; </TT></FONT></P>

<P>The next step is to update the source file for the class. Add the include file,
mmsystem.h, before the Tracker.h include file (see Listing 4.5). This file is for
the timer functions that you take advantage of throughout the server implementation.</P>

<P>The following line is added within the constructor:</P>
<P><FONT COLOR="#0066FF"><TT><BR>
AFX_MANAGE_STATE(AfxGetStaticModuleState()); </TT></FONT></P>
<P>If you are using MFC with ATL, you must add this line as the first line in every
function that uses MFC. This line is needed to stabilize the state information that
is used by MFC. If you do not perform this step, the server will not function correctly
and can result in errors during program execution.</P>
<P>You must call the method <TT>AfxOleLockApp()</TT> to ensure that the application
will not be unloaded from memory until the reference count reaches zero.</P>
<P>Next you create a high resolution timer and store its current value in your member
variables. The timer is useful for determining the number of milliseconds that have
passed since the last method call was made. The timer output is great for tracking
the performance of a particular action or set of actions.</P>
<P>You then get the current date and create a filename with the format YYYYMMDD.tracklog.
After successfully opening the file, you output some start-up data to the file and
exit the constructor.</P>
<P>The destructor does the exact opposite of the constructor. If there is a valid
file handle, you write some closing information to the file and close it. Next you
terminate the timer. Remember to call the function <TT>AfxOleUnlockApp()</TT> to
allow the application to be removed from memory.
<H3><A NAME="Heading12"></A>Listing 4.5 TRACKER.CPP--Sample Server Support Code Added
to the Source File</H3>
<P><FONT COLOR="#0066FF"><TT><BR>
// Tracker.cpp : Implementation of CTracker <BR>
#include &quot;stdafx.h&quot; <BR>
#include &quot;ATLServer.h&quot; <BR>
// needed for the high resolution timer services <BR>
#include &lt;mmsystem.h&gt; <BR>
#include &quot;Tracker.h&quot; /////////////////////////////////////////////////////////////////////////////
<BR>
// CTracker STDMETHODIMP CTracker::InterfaceSupportsErrorInfo(REFIID riid) <BR>
{ <BR>
static const IID* arr[] = <BR>
{ <BR>
&amp;IID_ITracker, <BR>
}; <BR>

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品色哟哟| 成人性视频免费网站| 成人动漫一区二区| 日韩一级视频免费观看在线| 中文字幕在线一区| 另类小说色综合网站| 色妹子一区二区| 国产精品水嫩水嫩| 国产精品一区久久久久| 欧美日韩综合在线| 亚洲欧美另类小说| av在线播放一区二区三区| 精品粉嫩超白一线天av| 青青青爽久久午夜综合久久午夜| 日本道在线观看一区二区| ㊣最新国产の精品bt伙计久久| 韩日av一区二区| 欧美一区二区三区视频| 亚洲成人免费观看| 欧美视频完全免费看| 亚洲精品美腿丝袜| 欧美电影在线免费观看| ...中文天堂在线一区| 日韩激情视频在线观看| 在线观看亚洲一区| 国产精品狼人久久影院观看方式| 国产一区二区三区精品视频| 日韩情涩欧美日韩视频| 日韩av电影天堂| 欧美精品久久99| 亚洲综合一区二区三区| 在线一区二区三区四区| 中文字幕一区二区三区四区| 国产精品91一区二区| 久久先锋影音av鲁色资源| 国产露脸91国语对白| 91国偷自产一区二区三区观看| 日本一二三四高清不卡| 成人免费毛片片v| 国产精品欧美极品| 一本大道久久a久久精品综合| 一区二区三区91| 欧美色成人综合| 日本欧美在线观看| 欧美v日韩v国产v| 国产99久久精品| 亚洲精品美腿丝袜| 欧美一级日韩免费不卡| 狠狠色丁香婷综合久久| 国产精品高潮呻吟| 在线精品亚洲一区二区不卡| 天堂蜜桃91精品| 久久久久久久免费视频了| jlzzjlzz亚洲日本少妇| 亚洲国产中文字幕| 精品福利视频一区二区三区| 99久久精品国产观看| 亚洲第一激情av| 国产日韩欧美激情| 欧美性三三影院| 国产黄人亚洲片| 亚洲永久精品大片| 久久欧美一区二区| 欧美三级视频在线播放| 国产一区二区美女| 亚洲第一久久影院| 中文字幕不卡在线| 欧美丰满美乳xxx高潮www| 成人自拍视频在线观看| 亚洲妇熟xx妇色黄| 国产精品嫩草久久久久| 日韩欧美亚洲一区二区| 95精品视频在线| 老司机午夜精品| 亚洲成人综合网站| 中文字幕中文字幕中文字幕亚洲无线| 欧美裸体一区二区三区| 成人99免费视频| 久久99精品国产麻豆婷婷| 亚洲欧美区自拍先锋| 国产三级精品在线| 6080国产精品一区二区| 一本色道久久加勒比精品| 日韩一区二区免费电影| 婷婷丁香久久五月婷婷| 国产亚洲综合av| 欧美日韩高清在线| a在线播放不卡| 国产在线播放一区| 石原莉奈在线亚洲二区| 亚洲精品亚洲人成人网在线播放| 久久一区二区视频| 欧美一级高清大全免费观看| 在线视频欧美区| 国产精品996| 国产在线精品国自产拍免费| 午夜在线电影亚洲一区| 亚洲一级不卡视频| 国产精品看片你懂得| 久久蜜桃香蕉精品一区二区三区| 欧美一区二区网站| 久久免费看少妇高潮| 午夜欧美电影在线观看| 欧美国产一区视频在线观看| 欧美精品v国产精品v日韩精品| 91美女在线观看| 99久免费精品视频在线观看| 国产福利一区二区三区视频在线 | 久久婷婷成人综合色| 欧美人牲a欧美精品| 国产福利一区二区三区视频| 亚洲小说欧美激情另类| 国产精品久久三| 国产三级久久久| 国产欧美日韩久久| 国产精品久久久久影院| 国产精品久久久久婷婷| 亚洲天堂a在线| 亚洲美女淫视频| 亚洲成人动漫av| 视频一区二区不卡| 麻豆精品在线播放| 精品一区二区三区香蕉蜜桃| 国产精品一区二区久久精品爱涩 | 欧美激情在线观看视频免费| 国产日韩影视精品| 国产精品欧美一区二区三区| 亚洲欧美一区二区在线观看| 一区二区三区精品视频| 亚洲v中文字幕| 国内精品自线一区二区三区视频| 国产美女一区二区| av激情成人网| 欧美日本在线一区| 欧美精品一区二区不卡| 国产精品久久综合| 亚洲一区二区三区在线| 秋霞国产午夜精品免费视频| 国产精品69久久久久水密桃| 91小宝寻花一区二区三区| 欧美美女bb生活片| 国产亲近乱来精品视频| 亚洲精品国产一区二区精华液| 日日夜夜免费精品视频| 国产高清在线精品| 91视频一区二区三区| 欧美日韩你懂得| 国产欧美日韩综合| 五月综合激情婷婷六月色窝| 国产精品一区二区免费不卡| 欧美色图天堂网| 精品成人免费观看| 亚洲一区中文在线| 国产精品亚洲一区二区三区妖精 | 在线精品观看国产| 日韩精品一区国产麻豆| 亚洲精品中文字幕乱码三区| 国产一区二区不卡| 欧美精品一二三| 中文字幕欧美国产| 久久精品二区亚洲w码| 91福利社在线观看| 中文字幕av不卡| 日本午夜一本久久久综合| 972aa.com艺术欧美| 久久精品免费在线观看| 日本女人一区二区三区| 91亚洲国产成人精品一区二区三| 精品国产第一区二区三区观看体验| 亚洲欧洲日韩综合一区二区| 蜜桃av一区二区三区| 欧美在线你懂的| 国产精品视频在线看| 国产精品一区二区在线观看不卡| 欧美精品777| 一区二区三区加勒比av| 成人黄色av电影| 久久久久国产精品麻豆ai换脸| 无吗不卡中文字幕| 欧美亚洲一区二区三区四区| 亚洲欧美日韩系列| 成人小视频在线| 国产区在线观看成人精品| 久久99国产精品久久| 欧美一级理论性理论a| 亚洲高清三级视频| 在线观看www91| 亚洲精品欧美激情| 91在线视频播放| 自拍偷拍国产精品| 国产高清不卡一区| 国产三级一区二区| 高清不卡在线观看av| 国产人成亚洲第一网站在线播放 | 美女视频一区二区三区| 欧美日韩日日夜夜| 日韩高清欧美激情| 欧美一二三区在线观看| 免费日本视频一区| wwwwxxxxx欧美|