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

? 歡迎來(lái)到蟲(chóng)蟲(chóng)下載站! | ?? 資源下載 ?? 資源專(zhuān)輯 ?? 關(guān)于我們
? 蟲(chóng)蟲(chóng)下載站

?? ch15.htm

?? Learning language of Visual C++6
?? HTM
?? 第 1 頁(yè) / 共 4 頁(yè)
字號(hào):
<!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>

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人黄色a**站在线观看| 欧美成人一区二区三区片免费| 一区二区免费在线播放| 欧美一区二区三区播放老司机| www.日韩精品| 免费成人小视频| 亚洲日穴在线视频| 欧美精品一区二区三区蜜臀| 日本久久电影网| 国产黄色成人av| 奇米色一区二区| 亚洲国产日韩av| 亚洲色图视频免费播放| 久久久精品免费观看| 欧美精品自拍偷拍| 一本一道久久a久久精品| 国产精品亚洲专一区二区三区 | 91女人视频在线观看| 日韩成人伦理电影在线观看| 亚洲欧美日韩一区二区| 久久婷婷成人综合色| 欧美日本不卡视频| 99久久99久久精品免费观看| 国产精品一区二区你懂的| 免费看欧美女人艹b| 亚洲va天堂va国产va久| 一区二区三区在线看| 国产精品美女久久久久久2018| 欧美v日韩v国产v| 91精品国产综合久久香蕉的特点| 欧美在线观看你懂的| 95精品视频在线| 不卡一区二区中文字幕| 国产精品一区二区x88av| 久久69国产一区二区蜜臀| 视频一区二区三区在线| 亚洲成人午夜影院| 亚洲国产美女搞黄色| 一区二区三区四区中文字幕| 成人免费在线视频| 国产精品高潮呻吟| 欧美极品少妇xxxxⅹ高跟鞋| 中文字幕av一区 二区| 国产拍揄自揄精品视频麻豆| 久久久精品2019中文字幕之3| 欧美精品一区二区三区一线天视频 | 777亚洲妇女| 欧美精品第1页| 在线不卡中文字幕播放| 777久久久精品| 337p亚洲精品色噜噜噜| 日韩欧美中文一区二区| 精品免费视频.| 国产婷婷色一区二区三区四区| 国产网站一区二区三区| 国产精品国产三级国产三级人妇 | 亚洲三级在线免费观看| 亚洲乱码日产精品bd| 亚洲高清久久久| 免费久久精品视频| 国产麻豆精品theporn| 成人免费视频播放| 99re热这里只有精品视频| 91久久精品一区二区三| 欧美巨大另类极品videosbest| 日韩午夜中文字幕| 国产亚洲欧洲997久久综合| 国产精品午夜在线| 亚洲资源中文字幕| 麻豆中文一区二区| 国产成人自拍网| 色狠狠桃花综合| 91精品国产91久久久久久最新毛片| 欧美精品一区在线观看| 国产精品热久久久久夜色精品三区 | 一区二区三区欧美亚洲| 亚洲不卡一区二区三区| 狠狠色丁香久久婷婷综合丁香| 高清国产一区二区三区| 欧美三区在线视频| wwwwxxxxx欧美| 亚洲综合在线五月| 激情综合一区二区三区| 99久久99久久免费精品蜜臀| 欧美久久久久久蜜桃| 久久精品一区八戒影视| 亚洲一区二区三区四区的| 国内成人免费视频| 欧美在线综合视频| 久久免费看少妇高潮| 亚洲午夜视频在线| 国产福利一区二区三区| 欧美日韩精品二区第二页| 国产婷婷色一区二区三区| 亚洲国产精品久久人人爱蜜臀| 老司机午夜精品| 日本福利一区二区| 久久久久久一二三区| 亚洲成人高清在线| 成人av资源在线观看| 日韩美女一区二区三区| 亚洲另类色综合网站| 精一区二区三区| 欧美日韩久久不卡| 国产精品超碰97尤物18| 国模一区二区三区白浆| 8x8x8国产精品| 亚洲精品日韩专区silk| 国产成人av电影在线| 日韩欧美国产综合一区| 亚洲午夜免费视频| 97精品久久久午夜一区二区三区| 久久综合久久综合九色| 日韩福利电影在线| 欧美性受极品xxxx喷水| 国产精品家庭影院| 国产成人精品亚洲日本在线桃色| 欧美日本一道本| 亚洲一区二区三区四区中文字幕| 不卡电影一区二区三区| 精品国产一区二区国模嫣然| 日本午夜精品一区二区三区电影| 欧洲一区在线电影| 亚洲欧美另类小说视频| 日韩免费视频一区| 午夜视频一区二区| 在线免费不卡视频| 亚洲色图制服诱惑 | 综合电影一区二区三区| 国产 日韩 欧美大片| 久久日韩粉嫩一区二区三区| 久久99国产精品久久| 日韩免费电影一区| 麻豆免费看一区二区三区| 3d成人h动漫网站入口| 亚洲成精国产精品女| 欧美日韩国产在线观看| 亚洲欧美偷拍另类a∨色屁股| 成人一区二区在线观看| 中文一区一区三区高中清不卡| 国产麻豆视频精品| 国产日韩欧美制服另类| 风间由美性色一区二区三区| 中文字幕av免费专区久久| 国产精品18久久久久| 国产欧美综合在线| 成人av免费在线播放| 国产精品久久久久久久午夜片| 不卡视频在线看| 亚洲人成网站在线| 色婷婷av一区二区三区gif| 亚洲精品福利视频网站| 色天天综合色天天久久| 亚洲亚洲精品在线观看| 欧美精品成人一区二区三区四区| 日本不卡一区二区三区高清视频| 日韩精品中文字幕一区二区三区| 久久99在线观看| 久久久噜噜噜久噜久久综合| 成人黄色小视频| 一区二区三区四区国产精品| 91黄色免费网站| 日本女优在线视频一区二区| 久久婷婷国产综合精品青草| 成人avav影音| 亚洲福利电影网| 2020国产精品| 成人18视频在线播放| 亚洲第一狼人社区| 精品精品欲导航| 972aa.com艺术欧美| 视频一区二区中文字幕| 欧美激情一区二区三区在线| 91福利在线观看| 91精品国产综合久久婷婷香蕉 | 欧美日韩高清一区| 久久精品国产亚洲高清剧情介绍| 久久九九影视网| 欧美午夜精品久久久| 久久99精品久久久久| 1024国产精品| 日韩三级视频在线观看| 99re这里只有精品首页| 免费xxxx性欧美18vr| 国产精品久久久久久久久图文区 | 欧美亚洲丝袜传媒另类| 激情综合色综合久久| 亚洲美腿欧美偷拍| 精品剧情在线观看| 91久久线看在观草草青青| 精品一区二区三区视频在线观看| 国产精品国产三级国产普通话蜜臀 | 国产一区福利在线| 一区二区三区久久| 国产日韩精品一区| 91精品国模一区二区三区| 色综合一区二区三区| 国产老女人精品毛片久久| 午夜精品久久久久久| 中文字幕中文字幕一区二区|