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

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

?? shell.html

?? windows系統(tǒng)編程 一本很好的書!值得看哦!
?? HTML
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
<html>
<head>
<title>Windows95 Shell Programming</title>
<meta  name="description" content="Using Win95 Shell in your program">
<meta name="keywords" content="reliable, software, cplusplus, source code, example, tutorial, object oriented, programming">
</head>

<body background="../images/grid.gif" bgcolor="white" text="black">
<script language="JAVASCRIPT">
<!--
if (navigator.onLine){
document.write("<!-- Spidersoft WebZIP Ad Banner Insert -->");
document.write("<TABLE width=100% border=0 cellpadding=0 cellspacing=0>");
document.write("<TR>");
document.write("<TD>");
document.write("<ILAYER id=ad1 visibility=hidden height=60></ILAYER>");
document.write("<NOLAYER>");
document.write("<IFRAME SRC='http://www.spidersoft.com/ads/bwz468_60.htm' width=100% height=60 marginwidth=0 marginheight=0 hspace=0 vspace=0 frameborder=0 scrolling=no></IFRAME>");
document.write("</NOLAYER>");
document.write("</TD>");
document.write("</TR>");
document.write("</TABLE>");
document.write("<!-- End of Spidersoft WebZIP Ad Banner Insert-->");
}
 //-->
</script>

<!--Home button and Title-->
<table cellpadding=10 width="100%">
	<tr>
	<td width=100 align=center valign=middle>
	<a href="../index.htm">
	<img src="../images/rsbullet.gif" alt="RS" border=0 width=39 height=39>
	<br>Home</a>
	<td>
	<font face="arial" color="#009966">
	<h1 align=center>Using Windows95 Shell and COM</h1>
	<p align=center>A. K. A. OLE
	</font>
</table>
<p>

<table width="100%"><!-- main table -->
<tr>
   <td width=10> <!-- Left margin -->
   <td> <!-- Middle column, there is also the right margin at the end -->

   <table cellpadding=10 cellspacing=0 width="100%"> <!-- central table -->
   <tr>
   <td bgcolor="#ffffff">

<hr><!--Text-->
<font size="+1"><b>COM programming is so difficult</b></font> that you shouldn't even try it without MFC. Right or wrong? <font color=red>Absolutely wrong!</font>. Granted, OLE and its successor COM have the elegance of a figure-skating hippopotamus. But putting MFC on top of COM is like dressing the hippo in an oversized clown suit.

<table cellpadding="5">
<tr>
<td width=40><a href="source/treesize.zip"><img src="images/brace.gif" width=16 height=16 border=0 alt="Download"></a>
<td bgcolor="#e0e080">Download the source of a sample application, <a href="source/treesize.zip">TreeSizer</a> (zipped 12K) (courtesy Laszlo Radanyi), that calculates the total size of all files in a given directory and all its subdirectories. It uses the Win95 shell browser to browse directories.
<td width=40>
</table>

<p>So what is a programmer to do when faced with the necessity to use some of the Windows 95 (and Windows NT 4.0) shell features that are only accessible through COM interfaces? Read on...
<p>To begin with, whenever you are planning to use COM, you have to tell the system to initialize the COM subsystem. Similarly, whenever you're done using COM, you should tell the system to uninitialize it. The simplest thing to do, is to define an object whose constructor initializes COM and whose destructor deinitializes it. The best place to place it is to embed it in the Controller object (see the <a href="generic.html">Generic</a> Windows program), like this.
<hr>
	<!--Yellow background table.-->
         	<table cellpadding=10 cellspacing=0 width="100%">
         		<tr>
		<td width=20>
            		<td bgcolor="#e0e080">
<pre><font face="courier"><!--Code-->class <font color="#cc0066"><b>Controller</b></font>
{
public:
    Controller (HWND hwnd, CREATESTRUCT * pCreate);
    ~Controller ();
    // ...
private:
    <b>UseCom    _comUser;</b> // I'm a COM user
	 
    Model       _model;
    View        _view;
    HINSTANCE   _hInst;
};

</font></pre><!--End Code-->
		<td width=20>
	</table><!--End of yellow background-->
<hr>
This way we are guaranteed that the COM subsystem will be initialized before any calls are made to it and that it will be deinitialized after the program has done its tear-down (i.e., after the View and the Model have been destroyed). 
<p>The UseCom class is very simple.
<hr>
	<!--Yellow background table.-->
         	<table cellpadding=10 cellspacing=0 width="100%">
         		<tr>
		            <td width=20>
            		<td bgcolor="#e0e080">
<pre><font face="courier"><!--Code-->class <font color="#cc0066"><b>UseCom</b></font>
{
public:
    UseCom ()
    {
        <font color="#009966">HRESULT</font> err = <font color="#000099"><b>CoInitialize</b></font> (0);
        if (err != <font color="#009966">S_OK</font>)
            throw "Couldn't initialize COM";
    }
    ~UseCom ()
    {
        <font color="#000099"><b>CoUninitialize</b></font> ();
    }
};
</font></pre><!--End Code-->
		<td width=20>
	</table><!--End of yellow background-->
<hr>
So far it hasn't been too difficult, has it? That's because we haven't touched the bane of COM programming--reference counting. You see, every time you obtain an interface, its reference count is incremented, every time you're done with it, you are supposed to <i>explicitly</i> decrement it. Oh, and it gets even weirder when you start querying, cloning, passing interfaces around, etc. But wait a moment, we know how to manage such problems! It's called <a href="../resource/index.htm">Resource Management</a>. We should never touch COM interfaces without encapsulating them in smart interface pointers. Here's how it works.
<hr>
	<!--Yellow background table.-->
         	<table cellpadding=10 cellspacing=0 width="100%">
         		<tr>
		            <td width=20>
            		<td bgcolor="#e0e080">
<pre><font face="courier"><!--Code-->
template &lt;class T&gt;class <font color="#cc0066"><b>SIfacePtr</b></font>
{
public:
    ~SIfacePtr ()
    {
        Free ();
    }
    T * operator-&gt;() { return _p; }
    T const * operator-&gt;() const { return _p; }
    operator T const * () const { return _p; }
    T const &amp; GetAccess () const { return *_p; }

protected:
    SIfacePtr () : _p (0) {}
    void Free ()
    {
        if (_p != 0)
            _p-&gt;<font color="#000099"><b>Release</b></font> ();
        _p = 0;
    }

    T * _p;
private:
    SIfacePtr (SIfacePtr const &amp; p) {}
    void operator = (SIfacePtr const &amp; p) {}
};
</font></pre><!--End Code-->
		<td width=20>
	</table><!--End of yellow background-->

<hr>
Don't worry that this class looks unusable (because it has a protected constructor). We'll never use it directly--we'll <i>inherit</i> from it. By the way, this is a great trick: create a class with a protected <i>do-nothing</i> constructor and keep deriving from it. All the derived classes will have to provide their own specialized public constructors. As you might have guessed, various classes derived from SIfacePtr will differ in the way they obtain, in their constructors, the interface in question.
<p>Private dummy copy constructor and operator= are not strictly necessary, but they will save you hours of debugging if, by mistake, you'll pass a smart interface by value rather than by reference. That's a big no-no. You'll end up releasing the same interface twice and that'll screw the COM's reference counting. Believe me, I've been there. As it is, the compiler will refuse to pass by value an object that has a private copy constructor (dummy or not). It will also issue an error when you try to assign an object that has a private assignment operator. 

<p>To wrap this short introduction up, let me present one more variation on the theme of smart pointers. Shell API's often allocate memory using their own special allocator. That wouldn't be so bad, if it weren't for the fact that they expect you to release this memory using the same allocator. So, whenever the shell hands us such an embarassing package, we'll wrap it up in a special smart pointer.
<hr>
	<!--Yellow background table.-->
   <table cellpadding=10 cellspacing=0 width="100%">
      <tr>
		<td width=20>
            		<td bgcolor="#e0e080">
<pre><font face="courier"><!--Code-->template &lt;class T&gt;
class <font color="#cc0066"><b>SShellPtr</b></font>
{
public:
    ~SShellPtr ()
    {
        Free ();
        _malloc-&gt;<font color="#000099"><b>Release</b></font> ();
    }
    T * weak operator-&gt;() { return _p; }
    T const * operator-&gt;() const { return _p; }
    operator T const * () const { return _p; }
    T const &amp; GetAccess () const { return *_p; }

protected:
    SShellPtr () : _p (0) 
    {
        // Obtain malloc here, rather than
        // in the destructor. 
        // Destructor must be fail-proof.
        // Revisit: Would static IMalloc * _shellMalloc work?
        if (<font color="#000099"><b>SHGetMalloc</b></font> (&amp; _malloc) == <font color="#009966">E_FAIL</font>)
            throw Exception "Couldn't obtain Shell Malloc"; 
    }

?? 快捷鍵說(shuō)明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
丰满放荡岳乱妇91ww| 日韩激情视频网站| 国产1区2区3区精品美女| 精品国产一区二区在线观看| 免费成人在线视频观看| 久久综合色播五月| 懂色一区二区三区免费观看| 国产蜜臀av在线一区二区三区| 北条麻妃一区二区三区| 亚洲欧美日韩国产综合| 欧美精品久久一区二区三区| 精品亚洲成av人在线观看| 日本一区二区三区国色天香| 91捆绑美女网站| 日韩精品福利网| 久久久国产精品午夜一区ai换脸| 99久久99久久精品免费看蜜桃| 亚洲一区二区3| 久久久久久久久久久99999| 99久久伊人精品| 亚洲bdsm女犯bdsm网站| 国产欧美日产一区| 在线不卡欧美精品一区二区三区| 麻豆国产精品一区二区三区| 国产精品福利一区| 欧美一区二区三区性视频| 国产成人免费9x9x人网站视频| 亚洲伦在线观看| 精品国产一区久久| 色爱区综合激月婷婷| 韩国女主播一区| 亚洲最新视频在线播放| 国产欧美一区二区三区在线看蜜臀| 在线观看国产精品网站| 国产精品一区二区无线| 亚洲成人资源网| 国产精品成人网| 精品免费视频.| 欧美性猛片xxxx免费看久爱| 国产精品亚洲成人| 日韩国产高清在线| 亚洲欧美日韩国产另类专区| 精品国精品国产| 欧美电影在线免费观看| 成人免费毛片a| 国产一区高清在线| 午夜精品影院在线观看| 亚洲精品精品亚洲| 国产精品久久久久久久裸模| 精品久久国产97色综合| 欧美日本一区二区三区四区| 99国产欧美另类久久久精品| 国内成+人亚洲+欧美+综合在线| 亚洲午夜久久久久久久久电影网| 国产精品久久久久久久久动漫| 精品国产乱码久久久久久老虎| 欧美日韩国产高清一区| 91久久免费观看| gogo大胆日本视频一区| 国产成人精品aa毛片| 精品一区二区三区在线观看国产 | 极品美女销魂一区二区三区免费| 亚洲视频1区2区| 国产精品高潮呻吟| 国产欧美日韩亚州综合| 久久精品人人做人人爽97| 欧美精品一区二区三区久久久| 欧美日韩国产一级片| 91官网在线观看| 91久久精品一区二区三| 一本一本久久a久久精品综合麻豆| 福利91精品一区二区三区| 国产福利电影一区二区三区| 韩国视频一区二区| 国产经典欧美精品| 成人夜色视频网站在线观看| 成人精品鲁一区一区二区| 福利一区福利二区| 不卡的看片网站| 一本大道综合伊人精品热热| 一本色道久久综合亚洲91| 欧美在线小视频| 在线观看91精品国产麻豆| 日韩一级免费一区| 久久亚洲精华国产精华液| 国产色91在线| 亚洲欧美综合色| 又紧又大又爽精品一区二区| 亚洲午夜av在线| 六月丁香综合在线视频| 国产一区二区不卡在线| 成人午夜电影网站| 色综合中文字幕国产 | 精品一区二区三区久久久| 精品在线观看免费| jizzjizzjizz欧美| 欧美日韩亚洲综合一区二区三区| 欧美一区二区三区爱爱| 国产婷婷色一区二区三区在线| 国产精品色婷婷| 亚洲观看高清完整版在线观看| 麻豆精品在线视频| 成人福利视频网站| 欧美日韩国产美| 国产亚洲欧美色| 亚洲自拍偷拍欧美| 久久精品国产网站| 色天使色偷偷av一区二区| 欧美精品久久99久久在免费线| 日韩欧美色综合| 国产精品卡一卡二卡三| 日本女人一区二区三区| 丁香网亚洲国际| 欧美日韩在线播放| 欧美国产精品一区| 免费欧美在线视频| 99国产精品国产精品久久| 日韩精品中午字幕| 亚洲精品综合在线| 国产在线国偷精品免费看| 日本道色综合久久| 久久婷婷国产综合国色天香| 亚洲激情欧美激情| 国产一区视频网站| 制服丝袜成人动漫| 亚洲天堂精品视频| 激情文学综合网| 欧美日韩国产一级| 国产精品久久毛片a| 精品中文av资源站在线观看| 在线观看不卡视频| 国产精品全国免费观看高清| 欧美aⅴ一区二区三区视频| 色婷婷综合久久久久中文一区二区| 日韩精品一区二区三区视频播放 | 成人av资源在线| 久久在线免费观看| 午夜欧美电影在线观看| 波多野结衣中文字幕一区二区三区| 欧美大白屁股肥臀xxxxxx| 亚洲图片欧美一区| 91福利精品第一导航| 中文字幕巨乱亚洲| 国内国产精品久久| 精品久久久久久久人人人人传媒 | 午夜视频在线观看一区二区三区 | 日本亚洲视频在线| 欧美在线你懂得| 国产精品久久久久影院色老大| 国产一区二区免费视频| 日韩一区二区影院| 日韩av网站在线观看| 欧美精品亚洲二区| 亚洲电影第三页| 欧美视频一区二区| 亚洲国产精品久久不卡毛片| 91久久免费观看| 一区二区三区精品久久久| 99久久国产免费看| 亚洲人成网站精品片在线观看| 国产成人免费视频网站| 国产色产综合色产在线视频| 国产一区欧美一区| 国产色一区二区| 不卡的电视剧免费网站有什么| 国产精品福利影院| 色婷婷av一区二区三区之一色屋| 亚洲天堂av一区| 欧美亚洲一区二区在线观看| 亚洲综合在线电影| 欧美色综合网站| 男男视频亚洲欧美| 精品国内片67194| 国产一级精品在线| 欧美极品少妇xxxxⅹ高跟鞋| 丁香六月久久综合狠狠色| 国产精品久久国产精麻豆99网站 | 欧美性猛交xxxxxx富婆| 午夜视频一区二区三区| 日韩一卡二卡三卡四卡| 久久99最新地址| 亚洲国产精品成人综合| 色欲综合视频天天天| 图片区小说区区亚洲影院| 日韩一区二区免费在线电影| 国产在线视频一区二区三区| 中文乱码免费一区二区| 色呦呦网站一区| 免费成人在线视频观看| 国产日韩av一区| 色综合久久久久久久| 日韩电影在线免费| 欧美激情一区二区三区蜜桃视频 | 麻豆91精品视频| 中文字幕二三区不卡| 色天天综合久久久久综合片| 捆绑调教一区二区三区| 欧美国产乱子伦| 欧美日韩一区精品| 国产精品一区二区无线|