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

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

?? ch04.htm

?? 用vc開發activex
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--last modified on Tue, Apr 15, 1997 9:46 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 4</TITLE>
</HEAD>

<BODY TEXT="#000000" BGCOLOR="#FFFFFF">

<H1>Chapter 4<BR>
Creating ActiveX Automation Servers Using ATL</H1>

<UL>
	<LI><A HREF="#Heading1">Creating ActiveX Automation Servers Using ATL</A>
	<UL>
		<LI><A HREF="#Heading2">Creating the Basic Project</A>
		<LI><A HREF="#Heading3">Adding an Automation Interface to the Application</A>
		<UL>
			<LI><A HREF="#Heading4">Listing 4.1 ATLSERVER.IDL--IDL File for the ATL Server Sample</A>
		</UL>
		<LI><A HREF="#Heading5">Registry</A>
		<UL>
			<LI><A HREF="#Heading6">Listing 4.2 ATLCONTROLWIN.RGS--Sample Registry Script File
			for the</A><A HREF="#Heading7">CTracker Server Object</A>
			<LI><A HREF="#Heading8">Listing 4.3 TRACKER.RGS--Updated Tracker.rgs File</A>
		</UL>
		<LI><A HREF="#Heading9">Sample Server Support Code</A>
		<UL>
			<LI><A HREF="#Heading10">Listing 4.4 Tracker.H--Sample Server Support Code Added
			to the</A> <A HREF="#Heading11">Tracker Header File</A>
			<LI><A HREF="#Heading12">Listing 4.5 TRACKER.CPP--Sample Server Support Code Added
			to the Source File</A>
		</UL>
		<LI><A HREF="#Heading13">Adding Methods</A>
		<UL>
			<LI><A HREF="#Heading14">Listing 4.6 ATLSERVER.IDL--OutputLines Method Added to the
			IDL File by the ATL ClassWizard</A>
			<LI><A HREF="#Heading15">Listing 4.7 TRACKER.H--OutputLines Function Prototype Added
			to the</A>
			<LI><A HREF="#Heading16">Tracker.h File</A>
			<LI><A HREF="#Heading17">Listing 4.8 TRACKER.CPP--OutputLines Function Implementation
			Added </A><A HREF="#Heading18">to the Tracker.cpp File</A>
			<LI><A HREF="#Heading19">Listing 4.9 TRACKER.H--m_1Indent Member Variable Added to
			the</A> <A HREF="#Heading20">Class Definition</A>
			<LI><A HREF="#Heading21">Listing 4.10 TRACKER.CPP--Member Initialization in the Constructor</A>
			<LI><A HREF="#Heading22">Listing 4.11 TRACKER.CPP--OutputLines Function Implementation
			Added to the Source File Tracker.cpp</A>
		</UL>
		<LI><A HREF="#Heading23">Adding Properties</A>
		<UL>
			<LI><A HREF="#Heading24">Listing 4.12 TRACKER.IDL--Indent Property Added to the IDL</A>
			<LI><A HREF="#Heading25">Listing 4.13 TRACKER.H--Indent Property Function Pair Prototypes
			Added to the Tracker.h File</A>
			<LI><A HREF="#Heading26">Listing 4.14 TRACKER.CPP--Indent Property Function Pair
			Implementation Added to the Tracker.cpp File</A>
			<LI><A HREF="#Heading27">Listing 4.15 TRACKER.CPP--Indent Property Implementation</A>
		</UL>
		<LI><A HREF="#Heading28">Generating OLE Exceptions</A>
		<UL>
			<LI><A HREF="#Heading29">Listing 4.16 ATLSERVER.IDL--Error Enumeration Added to the
			IDL File</A>
			<LI><A HREF="#Heading30">Listing 4.17 TRACKER.CPP--Rich Error Information Added to
			Tracker</A>
			<LI><A HREF="#Heading31">Implementation</A>
		</UL>
		<LI><A HREF="#Heading32">Dual-Interface</A>
		<LI><A HREF="#Heading33">Generating Dual-Interface OLE Exceptions</A>
		<LI><A HREF="#Heading34">Server Instantiation Using C++</A>
		<LI><A HREF="#Heading35">Shared Servers</A>
		<UL>
			<LI><A HREF="#Heading36">Listing 4.18 STDAFX.H--Shared Object Support Classes and
			Macros</A>
			<LI><A HREF="#Heading37">Listing 4.19 TRACKER.H--Shared Server Support Added to Ctracker
			Class</A>
		</UL>
		<LI><A HREF="#Heading38">Single Instance Servers</A>
		<UL>
			<LI><A HREF="#Heading39">Listing 4.20 STDAFX.G--Single Instance Server Support Added
			to StdAfx.h</A>
			<LI><A HREF="#Heading40">Listing 4.21 TRACKER.H--Single Instance Server Support Added
			to CTracker Class</A>
		</UL>
		<LI><A HREF="#Heading41">From Here...</A>
	</UL>
</UL>

<P>
<HR SIZE="4">

<H1><A NAME="Heading1"></A>Creating ActiveX Automation Servers Using ATL</H1>

<UL>
	<LI><B>Server registration support</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 Automation servers depend on the registry for information about how they are implemented
	and used.
	<P>
	<LI><B>Adding methods and properties</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 Methods allow the user of the server to access specific functionality in the server.
	Properties provide a uniform mechanism for getting and setting the state of a server's
	data variables.
	<P>
	<LI><B>OLE exceptions</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 Unlike MFC, ATL does not support OLE exceptions through a C++ exception; rather
	it takes advantage of OLE error mechanisms.
	<P>
	<LI><B>Dual-interface</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 ATL servers implement dual- interface as a standard feature of the application.
	<P>
	<LI><B>Creating servers using C++</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 C++ can be used to launch servers from the application in which they are defined.
	<P>
	<LI><B>Shared and single instance servers</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 Using a server that is already running is usually the choice of the controller of
	the server, not the implementer. With a single instance server, the server implementer
	is responsible for the reuse of a server that is already running.
</UL>

<P>The ActiveX Template Library (ATL) was created to answer the need for lightweight
and fast ActiveX COM components. In addition to creating COM Objects and Controls,
ATL can be used to create Automation Servers with a minimum of effort and overhead.
ATL consists of a set of template classes that are a relatively new concept to most
developers; however, the focus of this chapter is on creating Automation Servers.
Please see your favorite C++ book or manual for more information regarding the definition
and use of templates.</P>
<P>ATL is intended to solve the problems of COM com-ponent development and is not
an attempt to be an all-encompassing class library for creating applications. ATL
was designed to work with other class libraries, such as MFC or the Standard Template
Library (STL), that provide basic classes for string manipulation, array, lists,
memory management, and so on. You, the developer, have the freedom to choose which
class library best suits your needs and combine it with ATL to create small, fast
COM applications. In this chapter, you will create a simple in-process Automation
Server using ATL and MFC for logging string data to a file. The use of MFC will allow
you to concentrate on how to implement your server rather than on how to find alternative
methods to functions and classes you are familiar with. You could just as easily
opt not to use MFC, but then you would have to use the Windows API directly to implement
anything related to the OS. As it is, using MFC will not add much to your application
in terms of size.</P>
<P>As you proceed through the chapter, you will expand on your implementation, highlighting
some of the more advanced concepts of Automation Server creation using ATL.
<H2><A NAME="Heading2"></A>Creating the Basic Project</H2>
<P>When creating an Automation Server, the first step is to create a <I>basic project
</I>upon which you will build your application's features and functionality. Like
MFC, ATL has an AppWizard for creating the basic ATL project.</P>
<P>From the <U>F</U>ile menu, select the <U>N</U>ew menu item. In the New dialog
(see fig. 4.1), select the Projects tab. The Projects tab allows you the opportunity
to define several aspects of how the application will be created, for example, the
type of application to create, the name of the application, and the location where
you want the project created. For the type, select ATL COM AppWizard; enter the Project
<U>n</U>ame ATLServer, and the Lo<U>c</U>ation will be <TT>C:\que\ActiveX\ ATLServer</TT>.
Click the OK button to start the ATL COM AppWizard so you can further define the
properties of your server. <A HREF="Art/04/dfig01.jpg"><B>FIG. 4.1</B></A> <I><BR>
Define the new ATL server project in the New dialog.</I></P>
<P>In the ATL COM AppWizard -- Step 1 of 1 dialog (see fig. 4.2), select a Server
Type of <U>D</U>ynamic Link Library (DLL), and check the Support <U>M</U>FC check
box. Click the <U>F</U>inish button to continue. <A HREF="Art/04/dfig02.jpg"><B>FIG.
4.2</B></A> <I><BR>
Define the basic architecture of the ATL COM object with the ATL COM AppWizard.</I></P>
<P>The New Project Information dialog (see fig. 4.3) is used to confirm the settings
that were selected for the project prior to the creation of the actual source files.
This is the last step in the ATL COM AppWizard. &quot;But wait,&quot; you say, &quot;I
haven't defined any of my server properties.&quot; The ATL COM AppWizard takes a
slightly different approach from that of MFC. Only the basic source files are created
with the AppWizard, the remainder of the project is defined by the ATL ObjectWizard--thus
allowing for much better control of the project implementation versus MFC since the
developer can add any number of ActiveX Servers, Controls, or plain COM objects after
the basic project is created. After you have confirmed your project settings, click
the OK button to close the ATL COM AppWizard and create the ATLServer project. <A
HREF="Art/04/dfig03.jpg"><B>FIG. 4.3</B></A> <I><BR>
Confirm the new project settings with the New Project Information dialog.</I></P>
<P>The ATL AppWizard generates all of the basic files that are needed to create a
DLL-based ATL Automation Server. Table 4.1 lists all of the files that are created
and a brief explanation of their purpose. 
<TABLE BORDER="1" WIDTH="100%">
	<CAPTION><B>Table 4.1 </B><SPACER TYPE="HORIZONTAL" SIZE="10"><B>Basic Source Files Created
		by the ATL AppWizard</B></CAPTION>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP"><B>Filename</B></TD>
		<TD ALIGN="LEFT" VALIGN="TOP"><B>Description</B></TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">ATLServer.clw</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">VC++ project file.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">ATLServer.cpp</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">The main application source file and entry point for the DLL.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">ATLServer.def</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Standard application DEF file. This file contains the function export declarations
			needed for all in-process servers.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">ATLServer.dsp</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">VC++ project file.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">ATLServer.dsw</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">VC++ project file.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">ATLServer.idl</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Interface Definition Language file, which is used to create the type library for
			the server.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">ATLServer.ncb</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">VC++ project file.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">ATLServer.rc</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Standard resource file.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">StdAfx.cpp</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Standard precompiled header source file.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">ATLServerps.def</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Proxy/Stub DLL definition file.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">ATLServerps.mk</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Proxy/Stub MK file.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">StdAfx.h</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Standard precompiled header file. All of the MFC-specific include files are added
			here.</TD>
	</TR>
</TABLE>

<H2><A NAME="Heading3"></A>Adding an Automation Interface to the Application</H2>
<P>To be an <I>Automation Server</I>,<I> </I>an application must contain at least
one or more <TT>IDispatch</TT>-based interfaces. You will use the ATL ObjectWizard
to add your automation server interfaces to your application. From the <U>I</U>nsert
menu, select the New <U>A</U>TL Object menu item. Within the ATL ObjectWizard dialog
(see fig. 4.4), select the Objects item in the left panel to display the types of
ATL components that can be added. Your implementation will be an Automation Server,
so select the Simple Object icon. See the ATL documentation for more information
on the other types of objects that can be created. Click the <U>N</U>ext button to

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一本大道久久a久久精二百| 精品av久久707| 日韩写真欧美这视频| 国产精品卡一卡二卡三| 麻豆极品一区二区三区| 99久久99久久精品免费观看| 精品日韩一区二区三区免费视频| 亚洲欧美激情在线| 韩国毛片一区二区三区| 欧美日韩国产一区| 亚洲欧美日韩久久| 风间由美一区二区av101 | 亚洲综合丁香婷婷六月香| 狠狠色狠狠色综合系列| 在线成人免费观看| 一区二区三区在线影院| 99久久99久久久精品齐齐 | 欧美一区二区美女| 丝袜诱惑制服诱惑色一区在线观看| 国产一区视频导航| 欧美精品一区二区三区蜜桃 | 日韩久久久精品| 午夜精品aaa| 欧美日韩亚洲综合在线 欧美亚洲特黄一级 | 美国一区二区三区在线播放| 欧美日韩在线不卡| 亚洲一区二区影院| 在线观看亚洲一区| 一卡二卡欧美日韩| 欧美伊人久久久久久久久影院 | 在线免费av一区| 一区二区视频在线| 一本一道波多野结衣一区二区| ㊣最新国产の精品bt伙计久久| 成人av影视在线观看| 亚洲国产成人一区二区三区| 成人18精品视频| 综合欧美一区二区三区| 91老师片黄在线观看| 亚洲最快最全在线视频| 欧美日韩免费高清一区色橹橹| 亚洲h在线观看| 777午夜精品视频在线播放| 奇米影视一区二区三区| www成人在线观看| 成人午夜伦理影院| 亚洲欧美日韩成人高清在线一区| 在线亚洲一区观看| 日本亚洲视频在线| 国产视频亚洲色图| 色婷婷av久久久久久久| 日日嗨av一区二区三区四区| 久久久综合精品| 99久久久精品| 日韩高清一级片| 国产欧美日韩综合精品一区二区| 99久久精品免费| 香港成人在线视频| 日本一区二区三区四区在线视频| av在线不卡电影| 日韩不卡在线观看日韩不卡视频| 26uuu国产一区二区三区| aaa国产一区| 日本欧美一区二区三区乱码 | 亚洲风情在线资源站| 欧美大黄免费观看| 97超碰欧美中文字幕| 日韩中文字幕区一区有砖一区| 久久精品视频在线看| 欧美三级一区二区| 国产成人在线视频网址| 亚洲高清免费视频| 国产清纯白嫩初高生在线观看91 | 午夜精品视频一区| 久久欧美一区二区| 欧美日韩欧美一区二区| 成人h动漫精品一区二区| 免费成人结看片| 亚洲欧美成aⅴ人在线观看| 精品美女被调教视频大全网站| 不卡av免费在线观看| 蜜桃精品视频在线| 亚洲免费av观看| 国产拍欧美日韩视频二区| 欧美欧美欧美欧美首页| 97久久超碰精品国产| 激情综合五月婷婷| 亚洲va中文字幕| 自拍偷拍国产精品| 国产欧美va欧美不卡在线| 日韩三级精品电影久久久 | 五月婷婷综合网| ●精品国产综合乱码久久久久| 久久综合狠狠综合久久综合88| 欧美高清精品3d| 欧亚洲嫩模精品一区三区| 不卡一卡二卡三乱码免费网站| 激情综合亚洲精品| 美女网站色91| 三级不卡在线观看| 亚洲高清一区二区三区| 亚洲激情在线播放| 亚洲同性同志一二三专区| 欧美激情一区三区| 久久欧美中文字幕| 国产日本欧美一区二区| 欧美日本国产一区| 欧美日韩色一区| 欧美性xxxxxxxx| 亚洲午夜电影在线观看| 2020国产成人综合网| 精品粉嫩超白一线天av| 日韩欧美123| 色94色欧美sute亚洲线路一久| 亚洲国产精品久久不卡毛片| 日韩不卡免费视频| 一区二区三区色| 久久久噜噜噜久久中文字幕色伊伊 | 国产麻豆精品theporn| 美女高潮久久久| 专区另类欧美日韩| 精品国产91九色蝌蚪| 91网站在线播放| 国产成人亚洲精品狼色在线| 亚洲国产欧美一区二区三区丁香婷| 91精品国产一区二区三区蜜臀| 99视频精品在线| 狠狠狠色丁香婷婷综合激情| 亚洲一本大道在线| 日韩av网站免费在线| 亚洲va天堂va国产va久| 一卡二卡欧美日韩| 天天av天天翘天天综合网| 亚洲色图制服丝袜| 亚洲素人一区二区| 亚洲欧洲精品天堂一级| 国产精品国产自产拍高清av王其| 欧美一区二区三区视频在线 | 久久久99精品免费观看不卡| 欧美韩国一区二区| 久久久久久久精| 国产真实乱偷精品视频免| 91精品久久久久久久91蜜桃| 亚洲欧洲性图库| 麻豆国产精品官网| 91成人免费网站| 亚洲自拍偷拍麻豆| 极品少妇xxxx精品少妇偷拍| 婷婷丁香激情综合| 国产麻豆成人精品| 日本va欧美va欧美va精品| 麻豆精品在线播放| 风间由美一区二区三区在线观看 | 美日韩一区二区三区| 美女视频黄久久| 91猫先生在线| 日韩免费福利电影在线观看| 国产精品成人在线观看| 日日骚欧美日韩| 99视频一区二区| 日韩三级伦理片妻子的秘密按摩| 自拍偷拍国产亚洲| 经典三级在线一区| 欧美视频一区在线观看| 国产亚洲一区二区三区四区| 亚洲午夜一区二区三区| 国产精品影视在线观看| 欧美人狂配大交3d怪物一区| 欧美激情一区二区三区不卡| 婷婷六月综合网| 91视频免费播放| 国产亚洲综合色| 免费观看成人鲁鲁鲁鲁鲁视频| 91丨porny丨最新| 久久久www成人免费毛片麻豆 | 国产精品网站在线播放| 天堂久久一区二区三区| 91日韩精品一区| 久久久精品免费免费| 日韩电影在线一区| 欧美日韩国产精选| 亚洲女厕所小便bbb| 国产福利精品导航| 欧美白人最猛性xxxxx69交| 午夜精品久久久久久| 欧美专区亚洲专区| 亚洲精品一二三| 成人精品在线视频观看| 久久久久久久久99精品| 国产真实乱子伦精品视频| 精品日韩一区二区三区免费视频| 日本视频中文字幕一区二区三区| 欧美久久一区二区| 婷婷成人激情在线网| 欧美日韩一区二区在线观看视频| 亚洲综合自拍偷拍| 欧美午夜精品理论片a级按摩| 亚洲人成人一区二区在线观看 | 国产精品视频一二| 福利一区在线观看|