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

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

?? ch03.htm

?? 用VC開發ACTIVEX書籍和隨書源碼
?? HTM
?? 第 1 頁 / 共 5 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<!--last modified on Tue, Apr 15, 1997 9:17 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 3</TITLE>
</HEAD>

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

<H1>Chapter 3<BR>
<A NAME="Heading1"></A>Creating ActiveX Automation Servers Using MFC</H1>

<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 3.1 MFCSERVER.ODL--Dispinterface and CoClass ODL
			Entries</A>
			<LI><A HREF="#Heading5">Listing 3.2 TRACKER.H--Add the Class Factory Support with
			the Macro DECLARE_OLECREATE</A>
			<LI><A HREF="#Heading6">Listing 3.3 TRACKER.CPP--Add the Class Factory Implementationwith
			the IMPLEMENT_OLECREATE Macro</A>
		</UL>
		<LI><A HREF="#Heading7">Registry</A>
		<UL>
			<LI><A HREF="#Heading8">Server Registration</A>
			<LI><A HREF="#Heading9">Server Unregistration</A>
		</UL>
		<LI><A HREF="#Heading10">Sample Server Support Code</A>
		<UL>
			<LI><A HREF="#Heading11">Listing 3.4 TRACKER.H-- Sample Server Support Code Added
			to the Header File</A>
			<LI><A HREF="#Heading12">Listing 3.5 TRACKER.CPP--Updated Source File</A>
		</UL>
		<LI><A HREF="#Heading13">Adding Methods</A>
		<UL>
			<LI><A HREF="#Heading14">Listing 3.6 MFCSERVER.ODL--Updated ODL Entry for OutputLines
			Method</A>
			<LI><A HREF="#Heading15">Listing 3.7 TRACKER.H--New Member Variable Added to the
			Tracker Class</A>
			<LI><A HREF="#Heading16">Listing 3.8 TRACKER.CPP--Member Initialization in the Constructor</A>
			<LI><A HREF="#Heading17">Listing 3.9 TRACKER.CPP--OutputLines Method Implementation</A>
		</UL>
		<LI><A HREF="#Heading18">Adding Properties</A>
		<UL>
			<LI><A HREF="#Heading19">Listing 3.10 TRACKER.CPP--Indent Property Implementation</A>
		</UL>
		<LI><A HREF="#Heading20">Generating OLE Exceptions</A>
		<UL>
			<LI><A HREF="#Heading21">Listing 3.11 MFCSERVER.ODL--Error Enumeration</A>
			<LI><A HREF="#Heading22">Listing 3.12 TRACKERERROR.H--Tracker Error Constants</A>
			<LI><A HREF="#Heading23">Listing 3.13 TRACKER.CPP--Exception Handling Code Added
			to the Source Files</A>
		</UL>
		<LI><A HREF="#Heading24">Dual-Interface</A>
		<UL>
			<LI><A HREF="#Heading25">Listing 3.14 MFCSERVER.ODL--ODL Changes to Support Dual-Interface</A>
			<LI><A HREF="#Heading26">Listing 3.15 TRACKER.CPP--ODL-Generated Header File Is Added
			to the Tracker Source File</A>
			<LI><A HREF="#Heading27">Listing 3.16 TRACKER.H--Interface Macro Update of the Tracker
			Class Definition</A>
			<LI><A HREF="#Heading28">Listing 3.17 TRACKER.CPP--Interface Implementation of the
			ITracker Interface</A>
			<LI><A HREF="#Heading29">Listing 3.18 TRACKER.CPP--IDispatch Function Implementation
			for a Dual-Interface Server</A>
			<LI><A HREF="#Heading30">Listing 3.19 TRACKER.CPP--ITracker Function Implementation</A>
		</UL>
		<LI><A HREF="#Heading31">Generating Dual-Interface OLE Exceptions</A>
		<UL>
			<LI><A HREF="#Heading32">Listing 3.20 ERRORINFOMACROS.H--ISupportErrorInfo Helper
			Macros</A>
			<LI><A HREF="#Heading33">Listing 3.21 TRACKER.CPP--ISupportErrorInfo Include File</A>
			<LI><A HREF="#Heading34">Listing 3.22 TRACKER.H--ISupportErrorInfo Class Declaration</A>
			<LI><A HREF="#Heading35">Listing 3.23 TRACKER.CPP--ISupportErrorInfo Interface Implementation</A>
			<LI><A HREF="#Heading36">Listing 3.24 TRACKER.CPP--Custom Interface Exception Handling
			Code</A>
		</UL>
		<LI><A HREF="#Heading37">Server Instantiation Using C++</A>
		<LI><A HREF="#Heading38">Shared Servers</A>
		<UL>
			<LI><A HREF="#Heading39">Listing 3.25 TRACKER.H--Shared Object Member Variable Added
			to the CTracker Class</A>
			<LI><A HREF="#Heading40">Listing 3.26 TRACKER.CPP--CLSID Declaration</A>
			<LI><A HREF="#Heading41">Listing 3.27 TRACKER.CPP--RegisterActiveObject Added to
			the CTracker Constructor</A>
			<LI><A HREF="#Heading42">Listing 3.28 TRACKER.CPP--RevokeActiveObject Added to the
			Server</A>
		</UL>
		<LI><A HREF="#Heading43">Single Instance Servers</A>
		<UL>
			<LI><A HREF="#Heading44">Listing 3.29 SHAREDOBJECT.H--Shared Server Class Factory
			Header File</A>
			<LI><A HREF="#Heading45">Listing 3.30 SHAREDOBJECT.CPP--Shared Server Implementation
			File</A>
			<LI><A HREF="#Heading46">Listing 3.31 TRACKER.H--Shared Server Class Factory Support
			Added to the Class Definition</A>
			<LI><A HREF="#Heading47">Listing 3.32 TRACKER.CPP--Shared Server Update to Class
			Implementation</A>
			<LI><A HREF="#Heading48">Listing 3.33 TRACKER.CPP--Shared Server Release Implementation</A>
		</UL>
		<LI><A HREF="#Heading49">From Here...</A>
	</UL>
</UL>

<P>
<HR SIZE="4">

<UL>
	<LI><B>Methods and properties</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 MFC Class Wizard will greatly reduce the time required to implement your server.
	<P>
	<LI><B>OLE exceptions</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 MFC uses the class COleDispatchException for generating errors.
	<P>
	<LI><B>Dual-interface</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 The user of the Automatic Server users can choose between an IDispatch or COM interface
	when accessing the server. Dual-interface is not supported directly by MFC.
	<P>
	<LI><B>Dual-interface OLE exceptions</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 In dual-interface support, OLE exceptions are generated differently from standard
	MFC COleDispatchExceptions.
	<P>
	<LI><B>Creating servers using C++</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 C++ can be used to launch servers from the application they are defined in.
	<P>
	<LI><B>Shared and single instance servers</B> 
<SPACER TYPE="VERTICAL" SIZE="2">
 Accessing an already running server may be required. With a single instance server,
	the server implement is responsible for the reuse of an already running server.
</UL>

<P>MFC and Visual C++ (VC++) provide a very simple and easy to use framework for
creating ActiveX Automation Servers. In fact, the VC++ development environment's
AppWizard and ClassWizard are implemented with this in mind. Creating and manipulating
automation interfaces is one of VC++'s primary functions.</P>
<P>In this chapter, you will create a simple in-process Automation Server using MFC
for logging string data to a file. Throughout this chapter, you can use an application
such as Visual Basic (VB) to test your implementation. VB is perfect for accessing
Automation Servers since it takes so little time and code to do so.</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.
<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. MFC
provides an AppWizard that greatly simplifies this process. The AppWizard consists
of a set of structured dialogs and choices that, in the end, will result in a set
of files representing the basic application's project.</P>
<P>To create the basic project, you need to open the VC++ Integrated Development
Environment (IDE) and from the <U>F</U>ile menu, select the <U>N</U>ew menu item.
Select the Projects tab in the New dialog, and select MFC AppWizard (dll) as the
type. Enter the Project <U>n</U>ame MFCServer, and set the Lo<U>c</U>ation to the
\Que\ActiveX\MFCServer directory (see fig. 3.1). Click OK to continue. <B><BR>
<BR>
</B><A HREF="Art/03/cfig1r.jpg"><B>FIG. 3.1</B></A> <BR>
<I>Select the application type, name, and location of your new project.</I></P>
<P>In the MFC AppWizard -- Step 1 of 1 dialog, you define the specifics about how
your application is going to be created (see fig. 3.2). For the type of DLL to create,
select <U>R</U>egular DLL with MFC statically linked, which results in a slightly
larger application but one that should load faster because you won't have to load
the MFC DLLs whenever the server is launched. Also, check the A<U>u</U>tomation check
box--since that is the reason you are creating the application in the first place.
Click the <U>F</U>inish button to continue. <B><BR>
<BR>
</B><A HREF="Art/03/cfig2r.jpg"><B>FIG. 3.2</B></A> <BR>
<I>Define the specific application features in the MFC AppWizard -- Step 1 of 1 dialog.</I></P>
<P>The New Project Information dialog allows you to review your choices before creating
the actual project (see fig. 3.3). Click OK to complete the creation of your project.
<B><BR>
<BR>
</B><A HREF="Art/03/cfig4r.jpg"><B>FIG. 3.3</B></A> <I><BR>
Confirm the project settings in the New Project Information dialog.</I></P>
<P>The MFC AppWizard will create all the basic files that are needed to create a
DLL-based Automation Server. Table 3.1 lists all of the files that are created for
you and a brief explanation of what they are used for. 
<TABLE BORDER="1" WIDTH="100%">
	<CAPTION><B>Table 3.1 </B><SPACER TYPE="HORIZONTAL" SIZE="10"><B>Basic Source Files Created
		by the MFC 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">MFCServer.clw</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">VC++ project file.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">MFCServer.cpp</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Main application source file and entry point for the DLL.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">MFCServer.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">MFCServer.dsp</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">VC++ project file.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">MFCServer.dsw</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">VC++ project file.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">MFCServer.h</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Main application header file.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">MFCServer.ncb</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">VC++ project file.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">MFCServer.odl</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Standard Object Definition Language (ODL) file.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">MFCServer.rc</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Standard resource file.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">ReadMe.txt</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Text file that describes the project.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">Resource.h</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Resource header 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">StdAfx.h</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Standard precompiled header file. All the MFC-specific include files are added here.</TD>
	</TR>
	<TR ALIGN="LEFT" rowspan="1">
		<TD ALIGN="LEFT" VALIGN="TOP">Res\MFCServer.rc2</TD>
		<TD ALIGN="LEFT" VALIGN="TOP">Standard resource 2 file. This file contains all of the resource information that
			cannot be edited directly by VC++.</TD>
	</TR>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩国产美| 91在线看国产| 91精品国产综合久久久久| 亚洲国产色一区| 欧美日韩视频在线第一区| 视频一区二区不卡| 精品国产一二三| 成人一区二区三区视频| 亚洲色图一区二区三区| 欧美怡红院视频| 精品一区二区三区在线播放| 精品久久久久久综合日本欧美| 国产白丝网站精品污在线入口 | 欧美日本国产一区| 日本中文在线一区| 久久精品夜色噜噜亚洲aⅴ| 成年人国产精品| 亚洲国产成人精品视频| 日韩欧美一级二级三级久久久| 国产乱码精品一区二区三区忘忧草 | 亚洲精品日韩综合观看成人91| 欧美三日本三级三级在线播放| 日本不卡免费在线视频| 国产日韩成人精品| 在线观看日韩电影| 精品一区二区三区香蕉蜜桃| 亚洲欧洲精品成人久久奇米网| 欧美视频一区二区在线观看| 久久av老司机精品网站导航| 亚洲男人的天堂av| 日韩美女一区二区三区| 99精品国产视频| 免费的国产精品| 国产精品久久毛片av大全日韩| 欧美蜜桃一区二区三区| 成人激情黄色小说| 美女看a上一区| 亚洲欧美另类在线| 久久先锋影音av鲁色资源| 色天天综合久久久久综合片| 久久精品99国产精品| 亚洲人成网站色在线观看| 日韩欧美电影一二三| 日本电影欧美片| 国产精品一品视频| 青青草成人在线观看| 亚洲欧美电影院| 久久久av毛片精品| 欧美一级一区二区| 在线视频综合导航| 成人黄色在线视频| 久久国产精品72免费观看| 午夜视频一区二区三区| 国产精品麻豆欧美日韩ww| 日韩免费一区二区三区在线播放| 在线免费观看不卡av| 国产精品18久久久| 麻豆91精品91久久久的内涵| 一级特黄大欧美久久久| 国产欧美1区2区3区| 欧美成人女星排行榜| 欧美日韩一区二区三区四区| 91精彩视频在线观看| 粉嫩在线一区二区三区视频| 国内国产精品久久| 美女网站色91| 麻豆成人久久精品二区三区小说| 亚洲国产婷婷综合在线精品| 亚洲精品乱码久久久久久久久| 国产精品女主播在线观看| 国产日韩欧美电影| 国产亚洲人成网站| 国产网站一区二区| 久久色在线观看| 久久综合色婷婷| 精品国产一区二区三区不卡| 精品少妇一区二区三区视频免付费 | 激情综合网最新| 日本麻豆一区二区三区视频| 日韩福利电影在线| 天天色综合天天| 视频一区二区不卡| 久久精品国产久精国产爱| 日本不卡一区二区| 麻豆91免费观看| 国产成人一级电影| 成人免费高清视频在线观看| 成人av在线一区二区三区| 99精品欧美一区二区三区小说| 一本大道久久精品懂色aⅴ| 一本一道波多野结衣一区二区| 欧洲一区二区av| 欧美挠脚心视频网站| 日韩欧美亚洲另类制服综合在线| 日韩亚洲欧美一区| 久久久噜噜噜久久人人看 | 欧美一区二区三区思思人| 91精品国产一区二区三区蜜臀| 日韩欧美国产精品| 国产日本一区二区| 一区二区三区四区精品在线视频| 亚洲国产一区二区视频| 久久国产视频网| 成人午夜视频免费看| 91福利国产成人精品照片| 日韩一区二区在线观看视频| 欧美激情一区三区| 亚洲激情图片一区| 国产一区二区看久久| 91麻豆国产精品久久| 欧美精品tushy高清| 久久综合九色综合97_久久久 | 一区二区三区在线影院| 午夜电影网一区| 国产精品资源网| 欧美自拍偷拍一区| 2014亚洲片线观看视频免费| 最新日韩av在线| 美女视频黄 久久| 91亚洲男人天堂| 日韩精品中文字幕在线不卡尤物 | 夜夜揉揉日日人人青青一国产精品| 日本欧美久久久久免费播放网| 丁香亚洲综合激情啪啪综合| 欧美午夜片在线观看| 欧美国产成人精品| 日韩av电影免费观看高清完整版 | 亚洲国产综合在线| 国产一区三区三区| 欧美性猛交xxxxxxxx| 中文字幕乱码亚洲精品一区 | 激情综合色播激情啊| 色呦呦网站一区| 久久久久久久久99精品| 五月婷婷另类国产| 99久久精品国产网站| 精品国产欧美一区二区| 亚洲国产欧美在线人成| 成人精品视频一区| 精品国产91洋老外米糕| 亚洲va在线va天堂| 色综合天天综合给合国产| 精品三级av在线| 午夜视频久久久久久| 99re这里只有精品视频首页| 精品国产乱码久久久久久蜜臀 | 日本一区二区视频在线观看| 丝袜美腿一区二区三区| 色婷婷久久综合| 国产精品福利电影一区二区三区四区| 免费在线观看一区二区三区| 欧美色图激情小说| 艳妇臀荡乳欲伦亚洲一区| www.爱久久.com| 久久精品日产第一区二区三区高清版| 麻豆免费精品视频| 欧美一区在线视频| 日韩不卡免费视频| 欧美一区二区三区的| 天天综合天天综合色| 在线免费观看日本一区| 日韩美女啊v在线免费观看| 成人午夜精品在线| 国产精品嫩草影院av蜜臀| 国产成人午夜精品影院观看视频| 精品区一区二区| 激情成人午夜视频| 精品国产一区二区三区忘忧草| 久久精品国内一区二区三区| 日韩久久久久久| 国产伦精品一区二区三区视频青涩 | 人人爽香蕉精品| 欧美一区二区三区啪啪| 日韩激情av在线| 日韩欧美二区三区| 国产黑丝在线一区二区三区| 2021国产精品久久精品| 丰满少妇久久久久久久| 国产精品国模大尺度视频| 成人的网站免费观看| ●精品国产综合乱码久久久久 | 成人深夜福利app| 中文字幕不卡在线| 91免费小视频| 亚洲第一福利一区| 日韩精品一区二区三区在线播放 | 国内久久婷婷综合| 国产午夜精品理论片a级大结局| 国产成人午夜片在线观看高清观看| 中文字幕亚洲一区二区va在线| 色综合久久久久综合| 午夜激情综合网| 国产日韩欧美在线一区| 一本久道久久综合中文字幕 | 亚洲精品欧美激情| 欧美日韩美女一区二区| 精品无人码麻豆乱码1区2区 | 国产福利一区二区三区视频| 自拍偷在线精品自拍偷无码专区| 欧美日韩一二三|