亚洲欧美第一页_禁久久精品乱码_粉嫩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一区二区三区免费野_久草精品视频
日韩成人av影视| 欧美一区二区精品久久911| 欧美高清精品3d| **欧美大码日韩| 亚洲成av人**亚洲成av**| 亚洲妇熟xx妇色黄| 91麻豆精品秘密| 一区二区理论电影在线观看| 91一区一区三区| 亚洲一区二区三区四区在线观看| 一本一道久久a久久精品| 国产精品美女久久久久久久久久久 | 97se亚洲国产综合自在线不卡| 中文在线免费一区三区高中清不卡| 国产一区二区三区精品视频| 国产无一区二区| 色综合亚洲欧洲| 视频一区视频二区中文字幕| 日韩欧美在线1卡| 成人一区二区三区在线观看| 国产精品视频一二三区| 欧美三区在线观看| 激情小说欧美图片| 久久综合视频网| 色8久久精品久久久久久蜜| 亚洲一区成人在线| 久久综合九色综合97婷婷女人| 不卡视频在线观看| 麻豆精品在线看| 亚洲精品国产a| 久久蜜臀精品av| 欧美日韩中文另类| 成人黄色在线看| 另类欧美日韩国产在线| 亚洲国产精品高清| 波多野结衣视频一区| 亚洲成av人在线观看| 国产精品美女久久久久高潮| 欧美一区日本一区韩国一区| 99久久精品免费观看| 热久久国产精品| 亚洲国产精品麻豆| 亚洲私人影院在线观看| 日本一区二区免费在线| 欧美电影精品一区二区| 欧美一区二区三区精品| 欧美精品tushy高清| 91国产成人在线| 色综合久久综合网97色综合| 国产91综合一区在线观看| 精品一区二区影视| 激情亚洲综合在线| 精品一区二区三区免费观看 | 成人av免费在线观看| 国产精品影视在线| 国产成人综合在线播放| 国产+成+人+亚洲欧洲自线| 国产一区啦啦啦在线观看| 国产在线视频精品一区| 国产伦精一区二区三区| 国产高清在线精品| 成人app软件下载大全免费| 成人免费视频视频在线观看免费 | 国产精品视频第一区| 中文字幕在线观看不卡| 一区二区欧美国产| 亚洲国产综合人成综合网站| 欧美国产一区视频在线观看| 91精品国产入口在线| 日韩午夜激情视频| 国产精品亲子伦对白| 一区二区三区电影在线播| 日韩成人dvd| 91在线播放网址| 欧美另类久久久品| 国产午夜亚洲精品羞羞网站| 综合色中文字幕| 蜜臀91精品一区二区三区 | 色网站国产精品| 在线电影一区二区三区| 亚洲欧美自拍偷拍| 麻豆精品视频在线观看视频| 91一区二区三区在线播放| 精品久久一区二区三区| 午夜一区二区三区在线观看| 国产91高潮流白浆在线麻豆| 日韩视频中午一区| 亚洲在线免费播放| 99久久99久久精品免费观看| 6080yy午夜一二三区久久| 亚洲摸摸操操av| 成人小视频免费观看| 日韩视频国产视频| 亚洲大型综合色站| 欧美色图激情小说| 亚洲一二三区视频在线观看| 懂色中文一区二区在线播放| 久久精品一区二区三区不卡| 日韩黄色免费网站| 欧美一区二区三区公司| 视频一区中文字幕国产| 4438x亚洲最大成人网| 亚洲v中文字幕| 欧美日韩国产综合一区二区三区| 一区二区在线免费观看| 国产成人鲁色资源国产91色综| 91在线观看高清| 亚洲免费在线视频| 欧美日韩在线播放三区| 日韩黄色小视频| 国产亚洲美州欧州综合国| 国产不卡免费视频| 亚洲欧洲三级电影| 欧美日韩国产小视频在线观看| 尤物视频一区二区| 日韩欧美国产高清| 高清不卡一区二区在线| 亚洲啪啪综合av一区二区三区| 欧美亚日韩国产aⅴ精品中极品| 日精品一区二区| 久久奇米777| 在线视频亚洲一区| 蜜臀久久99精品久久久画质超高清| 久久综合五月天婷婷伊人| 色婷婷激情综合| 国产在线精品一区二区夜色 | 椎名由奈av一区二区三区| 欧美顶级少妇做爰| 99re视频精品| 五月婷婷久久综合| 亚洲精品成人天堂一二三| 日韩精品一区在线| 欧美日韩国产系列| 91麻豆福利精品推荐| 国产在线精品一区在线观看麻豆| 亚洲无线码一区二区三区| 久久久久久久久一| 日韩欧美一卡二卡| 色综合激情久久| 成人综合激情网| 极品少妇一区二区| 蜜臀av国产精品久久久久| 亚洲一区二区三区四区在线免费观看| 日本一区二区三区在线不卡| 日韩欧美一区二区不卡| 日韩欧美中文一区| 欧美一二三区在线观看| 欧美精品在线一区二区| 国产91综合网| 老司机精品视频在线| 奇米888四色在线精品| 视频一区二区国产| 久久国产综合精品| 韩国成人精品a∨在线观看| 国内精品嫩模私拍在线| 久久国内精品自在自线400部| 奇米一区二区三区| 国产精品综合在线视频| gogo大胆日本视频一区| 色综合天天综合网国产成人综合天| 国产成人精品三级| 97精品超碰一区二区三区| 欧美性xxxxxx少妇| 日韩欧美一区二区视频| 久久亚洲一级片| 亚洲另类色综合网站| 日韩国产在线观看| 国产成人av一区| 色素色在线综合| 欧美va日韩va| 曰韩精品一区二区| 麻豆精品在线看| 欧美综合欧美视频| 久久久综合精品| 五月天网站亚洲| 成人免费电影视频| 欧美一区二区三区在线观看| 国产精品色眯眯| 另类小说图片综合网| 在线日韩av片| 国产精品午夜在线观看| 秋霞电影一区二区| 日本高清免费不卡视频| 国产日本亚洲高清| 毛片av中文字幕一区二区| 欧美在线不卡视频| 亚洲国产精品二十页| 国产美女视频一区| 精品国产乱码久久久久久老虎 | 欧美一区二区三区公司| 一区二区三区在线免费| 色综合天天综合网天天看片| 欧美韩国日本不卡| 国产乱人伦偷精品视频免下载| 欧美大片在线观看一区| 久久精品噜噜噜成人88aⅴ| 日韩欧美在线不卡| 国产毛片一区二区| 色婷婷av一区二区三区软件| 亚洲欧美综合网|