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

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

?? ch03.htm

?? 用vc開發(fā)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在线看国产| 成人精品国产福利| av一区二区三区四区| 99精品视频在线观看免费| 国产成人免费视| 国产成人午夜高潮毛片| 国产成人免费xxxxxxxx| 成人精品国产免费网站| 91欧美激情一区二区三区成人| 不卡高清视频专区| 99视频一区二区三区| 一道本成人在线| 在线免费观看一区| 欧美人xxxx| 日韩视频免费观看高清完整版在线观看 | 久久综合给合久久狠狠狠97色69| 欧美电视剧在线看免费| 精品日韩欧美在线| 国产亚洲美州欧州综合国| 中文字幕国产一区二区| 亚洲伦在线观看| 亚洲国产精品久久久久秋霞影院| 日韩中文欧美在线| 国产剧情一区二区三区| 91麻豆国产在线观看| 欧美日韩国产大片| 日韩精品中文字幕一区| 中文字幕av不卡| 亚洲综合在线第一页| 日日夜夜免费精品视频| 国内精品久久久久影院一蜜桃| 国产激情91久久精品导航| 成人免费视频app| 欧美在线影院一区二区| 日韩视频在线永久播放| 国产日韩亚洲欧美综合| 亚洲蜜臀av乱码久久精品蜜桃| 香蕉影视欧美成人| 国产高清一区日本| 91国产免费观看| 日韩欧美在线观看一区二区三区| 国产欧美日本一区视频| 亚洲国产精品久久久久秋霞影院 | 性欧美大战久久久久久久久| 国内久久精品视频| 色呦呦国产精品| 精品免费视频一区二区| 亚洲欧美一区二区久久 | 欧美色网一区二区| 久久久99精品久久| 亚洲午夜久久久久久久久电影院| 国产在线视频一区二区三区| 日本丶国产丶欧美色综合| 日韩欧美亚洲国产另类| 亚洲精品一卡二卡| 国产一区啦啦啦在线观看| 在线看日韩精品电影| 国产亚洲欧洲一区高清在线观看| 亚洲成人在线网站| 粉嫩绯色av一区二区在线观看| 欧美男人的天堂一二区| 一区免费观看视频| 麻豆精品国产91久久久久久 | 综合久久一区二区三区| 久久99精品久久久久久| 欧美亚洲动漫制服丝袜| 欧美激情一区二区在线| 六月婷婷色综合| 欧美日韩高清影院| 亚洲码国产岛国毛片在线| 国产风韵犹存在线视精品| 91精品国产全国免费观看| 亚洲精品五月天| 成人黄页在线观看| 26uuu国产电影一区二区| 午夜精品一区二区三区三上悠亚| 9i在线看片成人免费| 久久久亚洲精华液精华液精华液| 日韩国产精品大片| 欧美色区777第一页| 亚洲男人的天堂网| 成人精品亚洲人成在线| 欧美激情中文字幕一区二区| 国内一区二区视频| 欧美精品一区二区三区蜜桃视频 | 91同城在线观看| 亚洲国产高清aⅴ视频| 国内偷窥港台综合视频在线播放| 正在播放亚洲一区| 日精品一区二区| 欧美日韩视频在线第一区 | 精品中文av资源站在线观看| 欧美绝品在线观看成人午夜影视| 亚洲精品亚洲人成人网在线播放| www.成人网.com| 国产精品久久久久久户外露出| 国产a级毛片一区| 国产精品久久久久久久久免费樱桃 | 夜夜亚洲天天久久| 色琪琪一区二区三区亚洲区| 一区二区三区日韩精品视频| 91老师片黄在线观看| 亚洲欧美日韩国产另类专区| 99国产精品99久久久久久| 国产精品久久毛片av大全日韩| av在线这里只有精品| 中文字幕亚洲视频| 91色综合久久久久婷婷| 亚洲精品成人精品456| 一本到高清视频免费精品| 一区二区三区不卡视频| 欧美系列在线观看| 天使萌一区二区三区免费观看| 欧美日韩一区小说| 日韩精品久久理论片| 日韩欧美中文字幕一区| 国产精品综合网| 中文字幕中文字幕一区| 在线看国产日韩| 日本特黄久久久高潮| 精品乱人伦小说| 国产.欧美.日韩| 亚洲欧洲综合另类在线| 欧美日韩久久一区二区| 免费观看30秒视频久久| 久久九九久久九九| 一本色道久久综合狠狠躁的推荐| 偷拍一区二区三区四区| 欧美va亚洲va国产综合| 丁香五精品蜜臀久久久久99网站 | 洋洋成人永久网站入口| 欧美午夜在线观看| 午夜不卡在线视频| 成人一区二区三区| 成人av在线观| 亚洲黄色小视频| 色综合视频一区二区三区高清| 中文字幕一区二区5566日韩| 99久久精品久久久久久清纯| 国产精品久久久久久久久搜平片 | 久久电影网电视剧免费观看| 日韩欧美在线1卡| 国产乱码精品1区2区3区| 久久九九国产精品| 成人一区二区在线观看| 1区2区3区国产精品| 91极品视觉盛宴| 亚洲成av人片在线观看无码| 91精品国产综合久久久久久久久久| 日韩国产欧美在线观看| 精品国产区一区| 懂色中文一区二区在线播放| **欧美大码日韩| 欧美日韩在线三区| 久久电影国产免费久久电影| 欧美mv和日韩mv的网站| 国产成人久久精品77777最新版本| 国产精品区一区二区三区| 99精品欧美一区二区蜜桃免费| 一区二区三区在线免费视频| 欧美日韩精品系列| 国产在线日韩欧美| 136国产福利精品导航| 欧美精品久久天天躁| 国产精品综合av一区二区国产馆| 国产精品久久久久aaaa樱花| 精品1区2区3区| 国产一区二区三区在线观看免费| 国产精品福利一区二区三区| 欧美日韩亚州综合| 国产精品一线二线三线精华| 一区二区三区视频在线看| 欧美一区二区私人影院日本| 成人在线综合网| 性做久久久久久久久| 国产亚洲成av人在线观看导航| 色网综合在线观看| 国内外成人在线| 一区二区国产盗摄色噜噜| 精品理论电影在线观看| 在线视频一区二区三区| 精品一区二区精品| 亚洲一区二区三区精品在线| 久久久久久麻豆| 欧美日韩一区三区| 成人深夜在线观看| 奇米色一区二区| 亚洲欧美日韩系列| 久久久久久久久久久久久女国产乱 | 亚洲精品国产无套在线观| 日韩欧美电影一区| 在线精品视频一区二区三四| 国产一区二三区好的| 午夜精品123| 亚洲日本在线天堂| 国产农村妇女精品| 精品少妇一区二区三区在线视频| 欧美色综合天天久久综合精品|