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

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

?? ch15.htm

?? Learning language of Visual C++6
?? HTM
?? 第 1 頁 / 共 4 頁
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>

<HEAD>
<SCRIPT LANGUAGE="JavaScript">

<!--

function popUp(pPage) {
 var fullURL = document.location;
 var textURL = fullURL.toString();
 var URLlen = textURL.length;
 var lenMinusPage = textURL.lastIndexOf("/");
 lenMinusPage += 1;
 var fullPath = textURL.substring(0,lenMinusPage);
 popUpWin = window.open('','popWin','resizable=yes,scrollbars=no,width=525,height=394');
 figDoc= popUpWin.document;
 zhtm= '<HTML><HEAD><TITLE>' + pPage + '</TITLE>';
 zhtm += '<link rel="stylesheet" href="/includes/stylesheets/ebooks.css"></head>';
 zhtm += '<BODY bgcolor="#FFFFFF">';
 zhtm += '<IMG SRC="' + fullPath + pPage + '">';
 zhtm += '<P><B>' + pPage + '</B>';
 zhtm += '</BODY></HTML>';
 window.popUpWin.document.write(zhtm);
 window.popUpWin.document.close();
 // Johnny Jackson 4/28/98
 }

//-->
                                                                
</SCRIPT>
<link rel="stylesheet" href="/includes/stylesheets/ebooks.css">

	
	<TITLE>Special Edition Using Visual C++ 6 -- Ch 15 -- Building an ActiveX Server Application</TITLE>
</HEAD>

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

<CENTER>
<H1><IMG SRC="../button/que.gif" WIDTH="171" HEIGHT="66" ALIGN="BOTTOM" BORDER="0"><BR>
Special Edition Using Visual C++ 6</H1>
</CENTER>
<CENTER>
<P><A HREF="../ch14/ch14.htm"><IMG SRC="../button/previous.gif" WIDTH="128" HEIGHT="28"
ALIGN="BOTTOM" ALT="Previous chapter" BORDER="0"></A><A HREF="../ch16/ch16.htm"><IMG
SRC="../button/next.gif" WIDTH="128" HEIGHT="28" ALIGN="BOTTOM" ALT="Next chapter"
BORDER="0"></A><A HREF="../index.htm"><IMG SRC="../button/contents.gif" WIDTH="128"
HEIGHT="28" ALIGN="BOTTOM" ALT="Contents" BORDER="0"></A> 
<HR>

</CENTER>
<CENTER>
<H1>- 15 -</H1>

<H1>Building an ActiveX Server Application</H1>
</CENTER>

<UL>
	<LI><A HREF="#Heading1">Adding Server Capabilities to ShowString</A>
	<UL>
		<LI><A HREF="#Heading2">AppWizard's Server Boilerplate</A>
		<LI><A HREF="#Heading3">Showing a String Again</A>
	</UL>
	<LI><A HREF="#Heading4">Applications That Are Both Container and Server</A>
	<UL>
		<LI><A HREF="#Heading5">Building Another Version of ShowString</A>
		<LI><A HREF="#Heading6">Nesting and Recursion Issues</A>
	</UL>
	<LI><A HREF="#Heading7">Active Documents</A>
	<UL>
		<LI><A HREF="#Heading8">What Active Documents Do</A>
		<LI><A HREF="#Heading9">Making ShowString an Active Document Server</A>
	</UL>
</UL>

<P>
<HR SIZE="4">

<CENTER>
<H1></H1>
</CENTER>
<P>Just as AppWizard builds ActiveX containers, it also builds ActiveX servers. However,
unlike containers, the AppWizard code is complete, so there isn't much work to do
for improving the AppWizard code. This chapter builds a version of ShowString that
is only a server and discusses how to build another version that is both a container
and a server. You also learn about ActiveX documents and how they can be used in
other applications.</P>
<P>
<H2><A NAME="Heading1"></A>Adding Server Capabilities to ShowString</H2>
<P>Like Chapter 14, &quot;Building an ActiveX Container Application,&quot; this chapter
starts by building an ordinary server application with AppWizard and then adds the
functionality that makes it ShowString. This is far quicker than adding ActiveX functionality
to ShowString because ShowString doesn't have much code and can be written quickly.</P>
<P>
<H3><A NAME="Heading2"></A>AppWizard's Server Boilerplate</H3>
<P>Build the new ShowString in a different directory, making almost exactly the same
AppWizard choices as when you built versions of ShowString in Chapter 8, &quot;Building
a Complete Application: ShowString,&quot; and Chapter 14. Call it ShowString, and
choose an MDI application with no database support. In AppWizard's Step 3, select
full server as your compound document support. This enables the check box for ActiveX
document support. Leave this deselected for now. Later in this chapter you see the
consequences of selecting this option. Continue the AppWizard process, selecting
a docking toolbar, initial status bar, printing and print preview, context sensitive
Help, and 3D controls. Finally, select source file comments and a shared DLL. Finish
AppWizard and, if you want, build the project.</P>


<BLOCKQUOTE>
	<P>
<HR>
<strong>NOTE::</strong> Even though the technology is now called ActiveX, the AppWizard
	dialog boxes refer to compound document support. Many of the class names that are
	used throughout this chapter have Ole in their names as well. Although Microsoft
	has changed the name of the technology, it has not propagated that change throughout
	Visual C++ yet. You will have to live with these contradictions for awhile.&#160;
<HR>


</BLOCKQUOTE>

<P>There are many differences between the application you have just generated and
a do-nothing application without ActiveX server support. These differences are explained
in the next few sections.</P>
<P><B>Menus&#160;&#160;</B>There are two new menus in an ActiveX server application.
The first, called IDR_SHOWSTTYPE_SRVR_IP, is shown in Figure 15.1. When an item is
being edited in place, the container in-place menu (called IDR_SHOWSTTYPE_CNTR_IP
in the container version of ShoeString) is combined with the server in-place menu,
IDR_SHOWSTTYPE_SRVR_IP, to build the in-place menu as shown in Figure 15.2. The double
separators in each partial menu show where the menus are joined.</P>
<P><A HREF="javascript:popUp('15uvc01.gif')"><B>FIG. 15.1</B></A><B> </B><I>AppWizard
adds another menu for editing in place.</I></P>

<P><A HREF="javascript:popUp('15uvc50.gif')"><B>FIG. 15.2</B></A><B> </B><I>The container
and server in-place menus are interlaced during in-place editing.</I></P>

<P>The second new menu is IDR_SHOWSTTYPE_SRVR_EMB, used when an embedded item is
being edited in a separate window. Figure 15.3 shows this new menu next to the more
familiar IDR_SHOWSTTYPE menu, which is used when ShowString is acting not as a server
but as an ordinary application. The File menus have different items: IDR_SHOWSTTYPE_SRVR_EMB
has Update in place of Save, and Save Copy As in place of Save As. This is because
the item the user is working on in the separate window is not a document of its own,
but is embedded in another document. File, Update updates the embedded item; File,
Save Copy As doesn't save the whole document, just a copy of this embedded portion.</P>
<P><A HREF="javascript:popUp('15uvc02.gif')"><B>FIG. 15.3</B></A><B> </B><I>The embedded
menu has different items under File than the usual menu.</I></P>

<P><B><I>CShowStringApp</I>&#160;&#160;</B>Another member variable has been added
to this class. It is declared in ShowString.h as:</P>
<P>
<PRE>COleTemplateServer m_server;
</PRE>
<P>COleTemplateServer handles the majority of the work involved in connecting documents
to code, as you will see.</P>
<P>The following line is added at the top of ShowString.cpp:</P>
<P>
<PRE>#include &quot;IpFrame.h&quot;
</PRE>
<P>This sets up the class CInPlaceFrame, discussed later in this chapter. Just before
InitInstance(), the lines shown in Listing 15.1 are added.</P>
<P>
<H4>Listing 15.1&#160;&#160;Excerpt from ShowString.cpp--CLSID</H4>
<PRE>// This identifier was generated to be statistically unique for
// your app. You may change it if you prefer to choose a specific
// identifier.
// {0B1DEE40-C373-11CF-870C-00201801DDD6}
static const CLSID clsid =
{ 0xb1dee40, 0xc373, 0x11cf,
</PRE>
<PRE>     { 0x87, 0xc, 0x0, 0x20, 0x18, 0x1, 0xdd, 0xd6 } };
</PRE>
<P>The numbers will be different in your code. This Class ID identifies your server
application and document type. Applications that support several kinds of documents
(for example, text and graphics) use a different CLSID for each type of document.</P>
<P>As it did for the OLE container version of ShowString, CShowStringApp::InitInstance()
has several changes from the non-ActiveX ShowString you developed in Chapter 8. The
code in Listing 15.2 initializes the ActiveX (OLE) libraries.</P>
<P>
<H4>Listing 15.2&#160;&#160;Excerpt from ShowString.cpp--Initializing Libraries</H4>
<PRE>     // Initialize OLE libraries
     if (!AfxOleInit())
     {
          AfxMessageBox(IDP_OLE_INIT_FAILED);
          return FALSE;
</PRE>
<PRE>     }
</PRE>
<P>While still in CShowStringApp::InitInstance(), after the CMultiDocTemplate is
initialized but before the call to AddDocTemplate(), the following line is added
to register the menu used for in-place editing and for separate-window editing:</P>
<P>
<PRE>pDocTemplate-&gt;SetServerInfo(
          IDR_SHOWSTTYPE_SRVR_EMB, IDR_SHOWSTTYPE_SRVR_IP,
          RUNTIME_CLASS(CInPlaceFrame));
</PRE>
<P>A change that was not in the container version is connecting the template for
the document to the class ID, like this:</P>
<P>
<PRE>// Connect the COleTemplateServer to the document template.
     //  The COleTemplateServer creates new documents on behalf
     //  of requesting OLE containers by using information
     //  specified in the document template.
     m_server.ConnectTemplate(clsid, pDocTemplate, FALSE);
</PRE>
<P>Now when a user chooses Create New when inserting an object, the document used
for that creation will be available.</P>
<P>When a server application is launched to edit an item in place or in a separate
window, the system DLLs add /Embedding to the invoking command line. But if the application
is already running, and it is an MDI application, a new copy is not launched. Instead,
a new MDI window is opened in that application. That particular piece of magic is
accomplished with one function call, as shown in Listing 15.3.</P>
<P>
<H4>Listing 15.3&#160;&#160;Excerpt from ShowString.cpp--Registering Running MDI
Apps</H4>
<PRE>     // Register all OLE server factories as running.  This enables the
     //  OLE libraries to create objects from other applications.
     COleTemplateServer::RegisterAll();
     // Note: MDI applications register all server objects without regard
</PRE>
<PRE>     //  to the /Embedding or /Automation on the command line.
</PRE>
<P>After parsing the command line, the AppWizard boilerplate code checks to see if
this application is being launched as an embedded (or automation) application. If
so, there is no need to continue with the initialization, so this function returns,
as shown in Listing 15.4.</P>
<P>
<H4>Listing 15.4&#160;&#160;Excerpt from ShowString.cpp--Checking How the App was
Launched</H4>
<PRE>     // Check to see if launched as OLE server
     if (cmdInfo.m_bRunEmbedded || cmdInfo.m_bRunAutomated)
     {
          // Application was run with /Embedding or /Automation.
          // Don't show the main window in this case.
          return TRUE;
</PRE>
<PRE>     }
</PRE>
<P>If the application is being run standalone, execution continues with a registration
update:</P>
<P>
<PRE>// When a server application is launched standalone, it is a good idea
     //  to update the system Registry in case it has been damaged.
     m_server.UpdateRegistry(OAT_INPLACE_SERVER);
</PRE>
<P>ActiveX information is stored in the Registry. (The Registry is discussed in Chapter
7, &quot;Persistence and File I/O.&quot;) When a user chooses Insert, Object or Edit,
Insert Object, the Registry provides the list of object types that can be inserted.
Before ShowString can appear in such a list, it must be registered. Many developers
add code to their install programs to register their server applications, and MFC
takes this one step further, registering the application every time it is run. If
the application files are moved or changed, the registration is automatically updated
the next time the application is run standalone.</P>
<P><B><I>CShowStringDoc</I>&#160;&#160;</B>The document class, CShowStringDoc, now
inherits from COleServerDoc rather than CDocument. As well, the following line is
added at the top of ShowStringdoc.cpp:</P>
<P>
<PRE>#include &quot;SrvrItem.h&quot;
</PRE>
<P>This header file describes the server item class, CShowStringSrvrItem, discussed
in the CShowStringSrvrItem subsection of this section. The constructor, CShowStringDoc::CShowStringDoc(),
has the following line added:</P>
<P>
<PRE>     EnableCompoundFile();
</PRE>
<P>This turns on the use of compound files.</P>
<P>There is a new public function inlined in the header file so that other functions
can access the server item:</P>
<P>
<PRE>CShowStringSrvrItem* GetEmbeddedItem()
          { return (CShowStringSrvrItem*)COleServerDoc::GetEmbeddedItem(); }
</PRE>
<P>This calls the base class GetEmbeddedItem(), which in turn calls the virtual function
OnGetEmbeddedItem(). That function must be overridden in the ShowString document
class as shown in Listing 15.5.</P>
<P>
<H4>Listing 15.5&#160;&#160;ShowStringDoc.cpp--CShowStringDoc::OnGetEmbeddedItem()</H4>
<PRE>COleServerItem* CShowStringDoc::OnGetEmbeddedItem()
{
     // OnGetEmbeddedItem is called by the framework to get the 
     // COleServerItem that is associated with the document.  
     // It is only called when necessary.
     CShowStringSrvrItem* pItem = new CShowStringSrvrItem(this);
     ASSERT_VALID(pItem);
     return pItem;
</PRE>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
一区二区三区免费在线观看| 亚洲欧洲韩国日本视频| 成人免费在线观看入口| 免费成人在线网站| 麻豆91免费看| 538在线一区二区精品国产| 国产精品乱人伦中文| 蜜臀久久99精品久久久久久9| 99精品在线免费| 国产精品视频麻豆| 成人avav影音| 亚洲免费观看高清完整版在线 | 91在线免费视频观看| 2024国产精品视频| 国产一区二区看久久| 国产亲近乱来精品视频| 国产美女精品在线| 中文字幕国产精品一区二区| 丁香激情综合国产| 国产精品网站在线观看| 福利91精品一区二区三区| 欧美本精品男人aⅴ天堂| 国产在线精品一区二区三区不卡| 欧美一区二区免费视频| 蜜桃在线一区二区三区| 精品久久久久久久人人人人传媒 | 久久人人超碰精品| 国产精品综合二区| 亚洲人妖av一区二区| 色拍拍在线精品视频8848| 亚洲自拍偷拍麻豆| 欧美一区二区视频网站| 成人激情视频网站| 亚洲精品日产精品乱码不卡| 日韩精品中文字幕一区二区三区| 国产高清亚洲一区| 蜜臀精品一区二区三区在线观看| 国产精品久久久久久久久久久免费看 | 久久网这里都是精品| 色8久久人人97超碰香蕉987| 美腿丝袜一区二区三区| 国产精品久久三区| 日韩精品中文字幕在线不卡尤物 | 国产剧情一区在线| 亚洲美女在线国产| 国产午夜精品理论片a级大结局| 欧美系列在线观看| av电影一区二区| 国产成人精品免费一区二区| 蜜臀国产一区二区三区在线播放| 一区二区三区免费在线观看| 久久精品欧美一区二区三区麻豆 | 久久99热这里只有精品| 亚洲成a人片在线观看中文| 亚洲欧美国产毛片在线| 中文字幕av一区二区三区免费看| 91精品午夜视频| 4438成人网| 日韩一级大片在线| 日韩欧美美女一区二区三区| 日韩亚洲欧美高清| 久久综合网色—综合色88| 精品动漫一区二区三区在线观看| 91精品国产色综合久久不卡电影| 欧美一区二区在线免费播放| 欧美另类videos死尸| 欧美电影在哪看比较好| 精品99一区二区| 久久免费偷拍视频| 国产欧美一区二区精品仙草咪| 这里只有精品99re| 精品国产免费一区二区三区香蕉| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 欧美一区二区黄色| 久久精品日韩一区二区三区| 中文字幕一区三区| 亚洲电影在线免费观看| 中文av一区二区| 亚洲一区二三区| 免费一级欧美片在线观看| 国产精品一区一区| 欧美午夜精品免费| 久久综合九色综合欧美98| 夜色激情一区二区| 亚洲成人激情av| 国产精品一级在线| 欧美色精品在线视频| 日韩一区二区中文字幕| 日韩理论片在线| 韩国在线一区二区| 欧美日韩国产一级| 国产精品国产三级国产有无不卡| 亚洲午夜久久久久久久久久久| 国产精品一品视频| 欧美一区二区成人| 亚洲欧美色图小说| 美国毛片一区二区| 欧美中文字幕一区二区三区亚洲| 精品久久久网站| 久久99国产精品麻豆| 欧美一区二区三区小说| 日韩精品久久久久久| 91极品视觉盛宴| 亚洲最大成人综合| 欧美在线免费观看视频| 亚洲一区二区三区四区的| 成人av在线资源网| 国产欧美日本一区视频| 成人免费在线视频| a4yy欧美一区二区三区| 中文字幕av一区 二区| 国产aⅴ综合色| 亚洲视频电影在线| 欧美天堂一区二区三区| 亚洲国产日产av| 欧美日韩dvd在线观看| 日韩二区三区四区| 国产欧美一区二区精品秋霞影院 | 精品国产一区二区三区av性色| 免费观看在线综合色| 欧美精品一区男女天堂| 国产精品1区2区3区| 亚洲靠逼com| 欧美大肚乱孕交hd孕妇| 成人丝袜18视频在线观看| 国产精品成人一区二区三区夜夜夜| 一本大道久久a久久精二百| 亚洲视频在线观看一区| 欧美性生活久久| 国产精品中文字幕日韩精品| 国产精品盗摄一区二区三区| 欧美日韩综合不卡| 国产在线播放一区三区四| 亚洲高清免费观看 | 日韩精品一区二区三区在线播放| 国内精品在线播放| 亚洲成av人片| 久久久精品中文字幕麻豆发布| 欧美在线你懂的| 国产91精品露脸国语对白| 亚洲成人av资源| 国产精品你懂的| 日韩精品中午字幕| 日韩欧美激情四射| 欧美午夜精品久久久久久超碰| 日韩精品一级中文字幕精品视频免费观看 | 欧美婷婷六月丁香综合色| 97久久超碰国产精品电影| 国产一区视频在线看| 久久成人久久鬼色| 天堂在线一区二区| 人妖欧美一区二区| 久久er99精品| 国产成人av一区| 成人午夜碰碰视频| 成人午夜av影视| 99精品黄色片免费大全| www.在线欧美| 国产成人超碰人人澡人人澡| 成人av资源网站| 91免费视频观看| 欧美日韩午夜精品| 日韩欧美视频一区| 国产亚洲欧美日韩俺去了| 精品区一区二区| 亚洲欧洲精品天堂一级| 亚洲激情图片一区| 久久www免费人成看片高清| 成人午夜免费电影| 欧美日韩一区二区三区免费看| 色久综合一二码| 91精品国产高清一区二区三区| 2023国产精品视频| 亚洲精选视频在线| 久久精品国产网站| aaa欧美色吧激情视频| 欧美一区二区三区在线观看视频| 久久精品亚洲一区二区三区浴池| 亚洲青青青在线视频| 日韩影院免费视频| 成人深夜在线观看| 日韩美女在线视频| 日产欧产美韩系列久久99| 色综合久久综合中文综合网| 91精品国产手机| 亚洲综合激情网| 91碰在线视频| 亚洲视频在线观看三级| 成人在线综合网| 欧美亚洲综合色| 久久久国产精品麻豆| 日韩av在线发布| 色欧美88888久久久久久影院| 精品欧美乱码久久久久久| 亚洲线精品一区二区三区| 色屁屁一区二区| 亚洲免费伊人电影| 在线观看国产精品网站| 国产精品二三区| 9色porny自拍视频一区二区|