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

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

?? shell.html

?? windows系統編程 一本很好的書!值得看哦!
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
<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"; 
    }

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
精品国产sm最大网站免费看| 一本一道久久a久久精品| 国产成人亚洲综合a∨猫咪 | 久久精品夜色噜噜亚洲a∨| 国产精品久久二区二区| 毛片av一区二区三区| 91网站在线观看视频| 久久亚区不卡日本| 奇米888四色在线精品| 色嗨嗨av一区二区三区| 欧美va亚洲va国产综合| 日韩精品五月天| 91精品婷婷国产综合久久 | 中文字幕精品一区| 日韩黄色小视频| 在线这里只有精品| 中文字幕一区在线观看| 丰满亚洲少妇av| 国产欧美一区二区精品忘忧草 | 亚洲国产精品天堂| 日本乱码高清不卡字幕| 亚洲婷婷国产精品电影人久久| 老司机精品视频导航| 91精品婷婷国产综合久久性色| 一区二区三区国产精品| 色欧美88888久久久久久影院| 国产精品美女一区二区在线观看| 韩国女主播成人在线观看| 欧美不卡视频一区| 精彩视频一区二区三区| 日韩欧美你懂的| 久久99久久99小草精品免视看| 日韩一区二区三区三四区视频在线观看| 亚洲国产精品尤物yw在线观看| 色综合网色综合| 一区二区三区日韩欧美精品| 99在线精品视频| 亚洲欧美日韩电影| 欧美午夜寂寞影院| 五月激情六月综合| 日韩亚洲欧美成人一区| 蜜桃av噜噜一区二区三区小说| 欧美va亚洲va在线观看蝴蝶网| 黄网站免费久久| 久久婷婷久久一区二区三区| 国产美女视频91| 国产欧美精品一区| 91蜜桃网址入口| 五月综合激情网| 日韩欧美国产高清| 国产激情91久久精品导航| 国产日本一区二区| 91福利社在线观看| 日本伊人色综合网| 国产日韩欧美不卡在线| 色拍拍在线精品视频8848| 日韩福利视频网| 中文无字幕一区二区三区| 99国产精品一区| 五月综合激情网| 国产欧美精品区一区二区三区 | 美女高潮久久久| 中文字幕av不卡| 欧美疯狂做受xxxx富婆| 韩国女主播成人在线观看| 成人欧美一区二区三区小说| 欧美乱妇一区二区三区不卡视频| 国产中文字幕精品| 性感美女极品91精品| 国产欧美精品一区aⅴ影院| 欧美日韩中字一区| 国产成人午夜精品5599| 午夜欧美大尺度福利影院在线看| 久久久久久久久久美女| 欧美日韩国产在线播放网站| 国产成人精品亚洲日本在线桃色| 亚洲国产一区二区在线播放| 国产亚洲成av人在线观看导航 | 成人激情av网| 日韩av高清在线观看| 亚洲色图都市小说| 26uuu亚洲| 欧美日本在线看| 99精品国产一区二区三区不卡| 美女网站一区二区| 午夜精品一区在线观看| 亚洲色图自拍偷拍美腿丝袜制服诱惑麻豆| 4438x成人网最大色成网站| 91丨九色porny丨蝌蚪| 国产成人综合网| 久久精品99久久久| 日本欧美大码aⅴ在线播放| 亚洲黄一区二区三区| 国产精品久久久久影视| 久久这里只有精品6| 日韩欧美视频一区| 91精品欧美久久久久久动漫| 在线一区二区视频| 色婷婷香蕉在线一区二区| 不卡大黄网站免费看| 高清成人免费视频| 国产精品99久久久久久宅男| 男女男精品视频| 免费观看在线综合色| 日韩综合小视频| 午夜伦欧美伦电影理论片| 亚洲国产欧美在线| 亚洲主播在线观看| 亚洲二区在线视频| 亚洲国产成人av好男人在线观看| 亚洲天堂av老司机| 亚洲精品国产成人久久av盗摄| 中文字幕在线不卡| 亚洲日本在线看| 亚洲欧美日韩成人高清在线一区| 中文字幕一区二区三区在线观看| 日本一区二区三区dvd视频在线| 精品国产电影一区二区| 久久综合九色综合欧美就去吻| 久久香蕉国产线看观看99| 欧美精品一区二区三区蜜桃 | 成人精品视频.| 国产激情一区二区三区| 高清在线不卡av| 91在线小视频| 欧美日韩国产免费| 日韩欧美国产麻豆| 国产欧美一区二区三区鸳鸯浴 | 天天色天天爱天天射综合| 奇米亚洲午夜久久精品| 久久精品999| 成人avav影音| 欧美三级日韩三级| 日韩欧美成人一区| 中文字幕av资源一区| 一区二区三区欧美亚洲| 欧美96一区二区免费视频| 国产剧情av麻豆香蕉精品| www.欧美日韩| 欧美蜜桃一区二区三区| 日韩精品在线网站| 国产精品国产三级国产aⅴ中文| 亚洲一线二线三线久久久| 蜜臀av一级做a爰片久久| 成人av网站在线| 欧美日韩一区二区三区视频| 久久综合色之久久综合| 国产精品国产成人国产三级| 亚洲一区二区三区四区在线| 久久国产福利国产秒拍| 一本色道久久综合亚洲91| 欧美一级生活片| 日韩理论在线观看| 蜜臀av性久久久久蜜臀aⅴ四虎| av男人天堂一区| 日韩西西人体444www| 中文字幕一区免费在线观看| 麻豆国产欧美日韩综合精品二区| 成人av手机在线观看| 欧美一卡二卡在线| 亚洲天堂av一区| 国产精品影视天天线| 欧美色图免费看| 国产精品视频你懂的| 男人的天堂久久精品| 日本道精品一区二区三区| 久久久另类综合| 亚洲成人在线免费| 一本色道久久综合亚洲91| 久久久噜噜噜久噜久久综合| 视频一区视频二区中文| 色综合久久久久综合体| 国产欧美日韩视频一区二区 | 亚洲综合久久久久| 粉嫩13p一区二区三区| 亚洲精品一区二区三区蜜桃下载| 一区二区日韩av| 91欧美一区二区| 国产精品二区一区二区aⅴ污介绍| 黄色成人免费在线| 日韩一级高清毛片| 天堂蜜桃91精品| 欧美日精品一区视频| 亚洲一二三专区| 色噜噜狠狠成人网p站| 国产精品国产三级国产普通话蜜臀 | 欧美日韩成人在线一区| 亚洲黄色免费网站| 色综合中文字幕国产 | www.日韩av| 国产精品私房写真福利视频| 国产一区在线视频| 精品国精品国产尤物美女| 日本亚洲天堂网| 欧美一二三区在线| 麻豆久久一区二区| 精品久久99ma| 国产乱人伦偷精品视频免下载| 日韩午夜精品视频| 美女视频网站黄色亚洲|