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

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

?? ch20.htm

?? Learning language of Visual C++6
?? HTM
?? 第 1 頁 / 共 4 頁
字號:
CLASSID="CLSID:46646B43-EA16-11CF-870C-00201801DDD6"
TYPE="application/oleobject"
CODEBASE="dieroll.cab#Version=1,0,0,1"
PARAM_ForeColor="0"
PARAM_BackColor="16777215">
</OBJECT>
<BR>
Here is some text after the die
</BODY>
</PRE>
<PRE>&lt;/HTML&gt;
</PRE>
<P>It is the &lt;EMBED&gt; tag that brings up the plug-in. Because it's inside the
&lt;OBJECT&gt;...&lt;/OBJECT&gt; tag, Microsoft Internet Explorer and other browsers
that know the OBJECT tag will ignore the EMBED. This means that this HTML source
will display the control equally well in Netscape Navigator and in Explorer. You'll
probably want to include a link on your page to the NCompass page to help your readers
find the plug-in and learn about it.</P>
<P>Microsoft is committed to establishing ActiveX controls as a cross-platform, multibrowser
solution that will, in the words of its slogan, &quot;Activate the Internet.&quot;
The ActiveX control specification is no longer a proprietary document but has been
released to a committee that will maintain the standard. Don't pay any attention
to people who suggest you should only build these controls if your readers use Internet
Explorer!</P>
<P>
<H2><A NAME="Heading3"></A>Registering as Safe for Scripting and Initializing</H2>
<P>For any of your readers who operate with a Medium safety level, the control should
be registered as safe for scripting and initializing. This assures anyone who wants
to view a page containing the control that no matter what functions are called from
a script or what parameters are initialized through the PARAM attribute, nothing
unsafe will happen. For an example of a control that isn't safe, think of a control
that deletes a file on your machine when it executes. The default file is one you
won't miss or that probably won't exist. A page that put this control in a script,
or that initialized the filename with PARAM attributes, might order the control to
delete a very important file or files, based on guesses about where most people keep
documents. It would be simple to delete C:\MSOFFICE\WINWORD\WINWORD.EXE, for example,
and that would be annoying for Word users. Figure 20.3 shows the error message displayed
in Explorer when you are using the Medium safety level and load a page featuring
a control that isn't registered as script-safe or init-safe. The NCompass Labs plug-in,
ScriptActive, also refuses to load controls that are not registered as script-safe
and init-safe.</P>
<P><A HREF="javascript:popUp('20uvc03.gif')"><B>FIG. 20.3</B></A><B> </B><I>Explorer
alerts you to controls that might run amok.</I></P>
<P>First, you need to add three functions to DierollCtl.cpp. (They come unchanged
from the ActiveX SDK.) These functions are called by code presented later in this
section. Don't forget to add declarations of these functions to the header file,
too. The code is in Listing 20.3.</P>
<P>
<H4>Listing 20.3&#160;&#160;DierollCtl.cpp--New Functions to Mark the Control as
Safe</H4>
<PRE> ////////////////////////////////////////////////////////////////
 // Copied from the ActiveX SDK
 // This code is used to register and unregister a
 // control as safe for initialization and safe for scripting
 HRESULT CreateComponentCategory(CATID catid, WCHAR* catDescription)
 {
      ICatRegister* pcr = NULL ;
      HRESULT hr = S_OK ;
      hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr,
             NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&amp;pcr);
      if (FAILED(hr))
             return hr;
      // Make sure the HKCR\Component Categories\{..catid...} 
      // key is registered
      CATEGORYINFO catinfo;
      catinfo.catid = catid;
      catinfo.lcid = 0x0409 ; // english
      // Make sure the provided description is not too long.
      // Only copy the first 127 characters if it is
      int len = wcslen(catDescription);
      if (len&gt;127)
            len = 127;
      wcsncpy(catinfo.szDescription, catDescription, len);
      // Make sure the description is null terminated
      catinfo.szDescription[len] = `\0';
      hr = pcr-&gt;RegisterCategories(1, &amp;catinfo);
      pcr-&gt;Release();
      return hr;
}
HRESULT RegisterCLSIDInCategory(REFCLSID clsid, CATID catid)
{
    // Register your component categories information.
    ICatRegister* pcr = NULL ;
    HRESULT hr = S_OK ;
    hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr,
            NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&amp;pcr);
    if (SUCCEEDED(hr))
    {
           // Register this category as being &quot;implemented&quot; by
           // the class.
           CATID rgcatid[1] ;
           rgcatid[0] = catid;
           hr = pcr-&gt;RegisterClassImplCategories(clsid, 1, rgcatid);
    }
    if (pcr != NULL)
          pcr-&gt;Release();
    return hr;
}
HRESULT UnRegisterCLSIDInCategory(REFCLSID clsid, CATID catid)
{
    ICatRegister* pcr = NULL ;
    HRESULT hr = S_OK ;
    hr = CoCreateInstance(CLSID_StdComponentCategoriesMgr,
             NULL, CLSCTX_INPROC_SERVER, IID_ICatRegister, (void**)&amp;pcr);
    if (SUCCEEDED(hr))
    {
        // Unregister this category as being &quot;implemented&quot; by
        // the class.
        CATID rgcatid[1] ;
        rgcatid[0] = catid;
        hr = pcr-&gt;UnRegisterClassImplCategories(clsid, 1, rgcatid);
    }
    if (pcr != NULL)
    pcr-&gt;Release();
    return hr;
</PRE>
<PRE>}
</PRE>
<P>Second, add two #include statements at the top of DierollCtl.cpp:</P>
<P>
<PRE>#include &quot;comcat.h&quot;
#include &quot;objsafe.h&quot;
</PRE>
<P>Finally, modify UpdateRegistry() in DierollCtl.cpp to call these new functions.
The new code calls CreateComponentCategory() to create a category called CATID_SafeForScripting
and adds this control to that category. Then it creates a category called CATID_SafeForInitializing
and adds the control to that category as well. Listing 20.4 shows the new version
of UpdateRegistry().</P>
<P>
<H4>Listing 20.4&#160;&#160;DierollCtl.cpp--CDierollCtrl::CDierollCtrlFactory::UpdateRegistry()</H4>
<PRE>BOOL CDierollCtrl::CDierollCtrlFactory::UpdateRegistry(BOOL bRegister)
{
    // TODO: Verify that your control follows apartment-model threading rules.
    // Refer to MFC TechNote 64 for more information.
    // If your control does not conform to the apartment-model rules, then
    // you must modify the code below, changing the 6th parameter from
    // afxRegInsertable | afxRegApartmentThreading to afxRegInsertable.
    if (bRegister)
    {
        HRESULT hr = S_OK ;
        // register as safe for scripting
        hr = CreateComponentCategory(CATID_SafeForScripting,
                L&quot;Controls that are safely scriptable&quot;);
        if (FAILED(hr))
            return FALSE;
        hr = RegisterCLSIDInCategory(m_clsid, CATID_SafeForScripting);
        if (FAILED(hr))
            return FALSE;
        // register as safe for initializing
        hr = CreateComponentCategory(CATID_SafeForInitializing,
                L&quot;Controls safely initializable from persistent data&quot;);
        if (FAILED(hr))
            return FALSE;
        hr = RegisterCLSIDInCategory(m_clsid, CATID_SafeForInitializing);
        if (FAILED(hr))
            return FALSE;
        return AfxOleRegisterControlClass(
            AfxGetInstanceHandle(),
            m_clsid,
            m_lpszProgID,
            IDS_DIEROLL,
            IDB_DIEROLL,
            afxRegInsertable | afxRegApartmentThreading,
            _dwDierollOleMisc,
            _tlid,
            _wVerMajor,
            _wVerMinor);
        else
        {
        HRESULT hr = S_OK ;
        hr = UnRegisterCLSIDInCategory(m_clsid, CATID_SafeForScripting);
        if (FAILED(hr))
            return FALSE;
        hr = UnRegisterCLSIDInCategory(m_clsid, CATID_SafeForInitializing);
        if (FAILED(hr))
            return FALSE;
               return AfxOleUnregisterClass(m_clsid, m_lpszProgID);
        }
</PRE>
<PRE>}
</PRE>
<P>To confirm that this works, open Explorer and set your safety level to Medium.
Load the HTML page that uses the control; it should warn you the control is unsafe.
Then make these changes, build the control, and reload the page. The warning will
not reappear.</P>
<P>
<H2><A NAME="Heading4"></A>Choosing Between ActiveX and Java Applets</H2>
<P>Java is an application development language as well as an applet development language,
which means you can develop ActiveX controls in Java if you choose to, using a tool
like Microsoft's Visual J++ integrated into Developer Studio. When most people frame
a showdown like ActiveX versus Java, though, they mean ActiveX versus Java <I>applets</I>,
which are little, tightly contained applications that run on a Web page and can't
run standalone.</P>
<P>Many people are concerned about the security of running an application they did
not code, when they do not know the person or organization supplying the application.
The Java approach attempts to restrict the actions that applets can perform so that
even malicious applets can't do any real damage. However, regular announcements of
flaws in the restriction approach are damaging Java's credibility. Even if a Java
applet were guaranteed to be safe, these same restrictions prevent it from doing
certain useful tasks, since they cannot read or write files, send email, or load
information from other Internet sites.</P>
<P>The approach taken by Microsoft with ActiveX is the trusted supplier approach,
which is extendable to Java and any other code that can execute instructions. Code
is digitally signed so that you are sure who provided it and that it has not been
changed since it was signed. This won't prevent bad things from happening if you
run the code, but it will guarantee that you know who is to blame if bad things do
occur. This is just the same as buying shrink- wrapped software from the shelf in
the computer store. For more details, look at <A HREF="http://www.microsoft.com/ie/most/howto/trusted.htm"><B>http://www.microsoft.com/ie/most/howto/trusted.htm</B></A>
and follow some of the links from that page.</P>
<P>Probably the biggest difference between the ActiveX approach and the Java applet
approach is downloading. Java code is downloaded every time you load the page that
contains it. ActiveX code is downloaded once, unless you already have the control
installed some other way (perhaps a CD-ROM was sent to you in a magazine, for example)
and then never again. A copy is stored on the user's machine and entered in the Registry.
The Java code that is downloaded is small because most of the code involved is in
the Java Virtual Machine installed on your computer, probably as part of your browser.</P>
<P>The ActiveX code that's downloaded can be much larger, though the optimizations
discussed in the next section can significantly reduce the size by relying on DLLs
and other code already on the user's computer. If users come to this page once and
never again, they might be annoyed to find ActiveX controls cluttering their disk
and Registry. On the other hand, if they come to the same page repeatedly, they will
be pleased to find that there is no download time: The control simply activates and
runs.</P>
<P>There are still other differences. Java applets can't fire events to notify the
container that something has happened. Java applets can't be licensed and often don't
distinguish between design-time and runtime use. Java applets can't be used in Visual
Basic forms, VC++ programs, or Word documents in the same way that ActiveX controls
can. ActiveX controls are nearly 10 times faster than Java applets. In their favor,
Java applets are genuinely multiplatform and typically smaller than the equivalent
ActiveX control.</P>
<P>
<H2><A NAME="Heading5"></A>Using AppWizard to Create Faster ActiveX Controls</H2>
<P>Microsoft did not develop OCX controls to be placed in Web pages, and changing
their name to ActiveX controls didn't magically make them faster to load or smaller.
So the AppWizard that comes with Visual C++ has a number of options available to
achieve those ends. This chapter changes these options in the Dieroll control that
was already created, just to show how it's done. Because Dieroll is already a lean
control and loads quickly, these simple changes won't make much difference. It's
worth learning the techniques, though, for your own controls, which will surely be
fatter than Dieroll.</P>
<P>The first few options to reduce your control's size have always been available
on Step 2 of the ActiveX ControlWizard:</P>

<UL>
	<LI>Activates When Visible
	<P>
	<LI>Invisible at Runtime
	<P>
	<LI>Available in Insert Object Dialog Box
	<P>
	<LI>Has an About Box
	<P>
	<LI>Acts as a Simple Frame Control
</UL>

<P>If you are developing your control solely for the Web, many of these settings
won't matter anymore. For example, it doesn't matter whether your control has an
About box; users won't be able to bring it up when they are viewing the control in
a Web page.</P>
<P>The Activates When Visible option is very important. Activating a control takes
a lot of overhead activity and should be postponed as long as possible so that your
control appears to load quickly. If your control activates as soon as it is visible,
you'll add to the time it takes to load your control. To deselect this option in
the existing Dieroll code, open the Dieroll project in Developer Studio if it isn't
still open, and open DierollCtl.cpp with FileView. Look for a block of code like
the one in Listing 20.5.</P>
<P>
<H4>Listing 20.5&#160;&#160;Excerpt from DierollCtl.cpp--Setting Activates When Visible</H4>
<PRE>/////////////////////////////////////////////////////////////////////////////
// Control type information
static const DWORD BASED_CODE _dwDierollOleMisc =
    OLEMISC_ACTIVATEWHENVISIBLE |
    OLEMISC_SETCLIENTSITEFIRST |
    OLEMISC_INSIDEOUT |
    OLEMISC_CANTLINKINSIDE |
    OLEMISC_RECOMPOSEONRESIZE;
</PRE>
<PRE>IMPLEMENT_OLECTLTYPE(CDierollCtrl, IDS_DIEROLL, _dwDierollOleMisc)
</PRE>
<P>Delete the OLEMISC_ACTIVATEWHENVISIBLE line. Build a release version of the application.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品99一区二区三区| 亚洲免费在线观看视频| 久久精品人人做| 亚洲一级片在线观看| 国产综合色在线视频区| 欧美男女性生活在线直播观看| 久久综合九色综合欧美亚洲| 亚洲动漫第一页| 99国产精品国产精品久久| 欧美不卡123| 日韩av电影天堂| 色8久久人人97超碰香蕉987| 欧美极品xxx| 国产精品资源在线看| 日韩精品一区二区三区中文不卡| 亚洲小少妇裸体bbw| 一本久道中文字幕精品亚洲嫩| 国产欧美日韩另类一区| 精品在线观看免费| 日韩三级高清在线| 日本伊人午夜精品| 91麻豆精品国产91久久久久| 亚洲高清免费在线| 91久久精品一区二区二区| 亚洲美女屁股眼交| 在线观看91视频| 一区二区三国产精华液| 欧美亚洲国产一卡| 午夜视频在线观看一区| 777午夜精品免费视频| 亚洲一二三区视频在线观看| 欧美影院午夜播放| 亚欧色一区w666天堂| 欧美理论片在线| 日本亚洲视频在线| 久久先锋影音av鲁色资源网| 精品一区二区国语对白| 亚洲精品在线三区| 成人黄色在线看| 亚洲欧美中日韩| 在线观看国产91| 日韩精品电影在线观看| 日韩精品中文字幕在线一区| 狠狠色狠狠色综合系列| 欧美激情在线一区二区三区| 波多野结衣在线一区| 亚洲欧洲99久久| 欧美放荡的少妇| 精品一区二区在线播放| 国产精品伦理一区二区| 欧美性猛片xxxx免费看久爱| 日韩高清一区二区| 久久久五月婷婷| 91小视频免费观看| 日精品一区二区| 国产亚洲一区字幕| 色呦呦日韩精品| 秋霞影院一区二区| 国产视频911| 欧美影院精品一区| 国产一区二区三区香蕉| 亚洲美女视频在线观看| 日韩精品专区在线影院观看| eeuss鲁一区二区三区| 亚洲国产综合视频在线观看| 精品福利av导航| 91免费精品国自产拍在线不卡| 亚洲va天堂va国产va久| 国产日产欧美一区二区三区| 91久久人澡人人添人人爽欧美| 青青草原综合久久大伊人精品 | 精品日本一线二线三线不卡| 成人免费高清视频在线观看| 三级欧美在线一区| 国产精品青草综合久久久久99| 欧美日韩精品欧美日韩精品一综合| 国产一区二区中文字幕| 亚洲国产精品久久艾草纯爱| 久久精品在这里| 欧美巨大另类极品videosbest| 国产风韵犹存在线视精品| 亚洲mv大片欧洲mv大片精品| 中文字幕av不卡| 日韩欧美美女一区二区三区| 91福利资源站| www.欧美精品一二区| 秋霞影院一区二区| 亚洲主播在线观看| 亚洲丝袜美腿综合| 欧美国产精品中文字幕| 日韩欧美一级精品久久| 欧美日韩一区二区在线视频| av网站免费线看精品| 国产在线看一区| 久久99久久精品欧美| 日韩专区欧美专区| 亚洲一二三区在线观看| 亚洲激情一二三区| 亚洲人一二三区| 国产精品女人毛片| 国产欧美一区二区精品性| 日韩精品自拍偷拍| 日韩欧美在线123| 3d成人动漫网站| 欧美高清视频不卡网| 欧美午夜电影一区| 欧美亚洲国产一区在线观看网站| 91看片淫黄大片一级| 成人网页在线观看| 成人免费观看av| 99麻豆久久久国产精品免费| 成人做爰69片免费看网站| 成人一区在线看| 成人一区二区视频| av中文字幕在线不卡| 99国产精品久| 欧洲在线/亚洲| 欧美日韩三级一区二区| 欧美日韩一级视频| 日韩欧美一二区| 精品国产百合女同互慰| 久久综合九色综合欧美就去吻 | 在线播放中文一区| 正在播放亚洲一区| 精品精品欲导航| 国产亚洲精品bt天堂精选| 国产日本亚洲高清| 亚洲视频中文字幕| 亚洲动漫第一页| 久久精品国产99国产| 久久99精品国产麻豆婷婷洗澡| 国产一区二区福利| 99久久精品免费看国产| 在线观看日韩精品| 欧美成人vps| 国产精品私房写真福利视频| 亚洲精品videosex极品| 美洲天堂一区二卡三卡四卡视频| 久久黄色级2电影| 成人高清视频在线| 欧美私模裸体表演在线观看| 日韩午夜电影av| 国产精品免费免费| 日韩av中文字幕一区二区三区| 国产真实乱对白精彩久久| 91网站黄www| 欧美不卡视频一区| 亚洲日本va午夜在线影院| 麻豆国产精品视频| 一本色道久久综合精品竹菊| 欧美一级日韩一级| 国产精品福利一区二区| 午夜精品福利久久久| 国产91在线|亚洲| 欧美日韩在线亚洲一区蜜芽| 国产日韩欧美综合一区| 午夜精品一区二区三区电影天堂| 国产一区在线看| 欧美性色欧美a在线播放| 久久久久久久国产精品影院| 亚洲h在线观看| 成人免费毛片嘿嘿连载视频| 6080yy午夜一二三区久久| 国产精品短视频| 精品亚洲aⅴ乱码一区二区三区| 91黄视频在线| 国产精品五月天| 久99久精品视频免费观看| 欧美午夜理伦三级在线观看| 国产精品亲子乱子伦xxxx裸| 秋霞av亚洲一区二区三| 91久久奴性调教| 亚洲欧洲精品天堂一级| 国产乱码一区二区三区| 欧美一区二区三区日韩视频| 一区二区三区成人| 丁香六月久久综合狠狠色| 精品国产三级电影在线观看| 天天做天天摸天天爽国产一区| 99精品国产视频| 国产精品私人影院| 丁香六月久久综合狠狠色| 久久九九久久九九| 韩国v欧美v日本v亚洲v| 欧美一级专区免费大片| 丝袜亚洲另类丝袜在线| 欧美日韩国产综合一区二区| 一区二区三区在线视频免费| 99久久免费国产| 中文字幕日韩一区| 99re免费视频精品全部| 亚洲欧洲无码一区二区三区| www.亚洲激情.com| 中文字幕中文字幕一区| 成人毛片在线观看| 成人免费在线视频| 色偷偷久久一区二区三区| 亚洲综合在线五月| 欧美日韩一级片网站| 肉丝袜脚交视频一区二区|