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

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

?? olerant.html

?? windows系統(tǒng)編程 一本很好的書!值得看哦!
?? HTML
字號:
<html>
<head>
<title> OLE Rant </title>
<meta  name="description" content=" Criticism of OLE ">
<meta name="keywords" content="reliable, software, cplusplus, source code, example, tutorial, object oriented, programming, windows">
</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">
		<center><i><b>
			<font size="+3">What's Wrong with OLE</font>

			<p align=center><font size="+1">Insider's story</font>
		</b></i></center>
	</font>
</table>

<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%">
   <tr>
   <td bgcolor=white>
<hr><!--Text-->
<font size="+1"><b>You might have heard</b></font> or read critical opinions about OLE. Programmers mostly complain about the complex system of reference counting and the lack of support for inheritance. Microsoft evangelists counter this by saying that there is no other way, and that it's for your own good<sup>1</sup>.  Interfaces, it is said, <i>have to</i> be refcounted, and there is a clever hack called <b>aggregation</b> (fondly called <i>aggravation</i> by OLE programmers) that provides the same functionality as inheritance. Maybe they are right, maybe the problem of interacting with run-time-loadable objects is so complex that there simply isn't any better way? On the other hand, maybe OLE has a fatal flaw that just keeps popping up all over the place.
	<!--Yellow background.-->
	<table cellpadding=10 cellspacing=0 width="100%">
		<tr>
		<td width=20>
            		<td bgcolor="#e0e080">
<font face="courier" color="#cc0066"><b>
The fatal design flaw of OLE is the requirement that one should be able to get from any interface to any other interface.
</b></font>
		<td width=20>
	</table>
                <!--End of yellow background-->

Technically this interface jumping it is done by having every interface inherit from the mother of all interfaces, <i>IUnknown</i>. <i>IUnknown</i> has the fatal method <i>QueryInterface</i> that is supposed to return any interface supported by the current object. This single assumption precludes any possibility of having simple implementation of inheritance. Let me explain why.
<p>Suppose that you have an object <i>FooObj</i> with an interface <i>IFoo</i>. This situation is easily modeled in C++ by having an abstract class (all methods pure virtual) <i>IFoo</i> and a concrete class <i>FooObj</i> that inherits from <i>IFoo</i> and implements all its methods.
<p>Now you would like to extend this object by adding support for another interface <i>IBar</i>. In C++ it's trivial, you just define a class <i>FooBarObj</i> that inherits from <i>FooObj</i> and <i>IBar</i>. This new class supports the <i>IFoo</i> interface together with its implementation through inheritance from <i>FooObj</i>. It also supports the interface <i>IBar</i> and provides the implementation of <i>IBar</i> methods. 
<center><img src="images/inherit.gif" width=267 height=300 vspace=10 border=0 align="middle" alt="Inheritance diagram"></center>
Anybody who knows C++ can do it with their eyes closed. So why can't you do the same in OLE? Here comes the Flaw. You have to be able to obtain the <i>IBar</i> interface from the <i>IFoo</i> interface using its <i>QueryInterface</i>. But, wait a minute, the object <i>FooObj</i> that provides the implementation of all methods of <i>IFoo</i>, including <i>QueryInterface</i>, had no clue about <i>IBar</i>! It could have been created long before anyone even thought about the possibility of <i>IBar</i>. So how can it provide access to <i>IBar</i>?
<p>Good question. I'm not going to go into the gory details of the aggregation hack that is supposed to solve this problem. Given the constraints of the flawed initial design, it is a truly ingenious hack. So is there a better design? Read on...
<hr>
<font size="+1"><b>Have you ever noticed</b></font> how one is forced to distinguish between the <b>object</b> that implements interfaces and the <b>interfaces</b> themselves? These are two completely different notions. You can't explain anything in OLE without talking about objects, sometimes called components. Interfaces are important, but objects are even more important. When can you get one interface from another? When they share the same underlying object. You can change the state of an object using one interface and then examine this state through another interface. It's obviously the same object! In my example I described two interfaces, <i>IFoo</i> and <i>IBar</i>, and two objects (or classes of objects), <i>FooObject</i> and <i>FooBarObject</i>.
<p>In fact, anybody who's the <i>implementor</i> of interfaces (whether in C++, C, or Basic) has to deal with objects. Nevertheless, this very important abstraction is completely absent from the client's view of OLE. All that the client sees are interfaces. The underlying object is like a ghost.
<p>But it's <i>not</i> a ghost, it is physically present in the address space of your program, either directly, or as a forwarding stub. So why hide it? Indeed, wouldn't OLE be simpler with the explicit notion of an object? Let's see how it would work.
<p>The client of this "smart OLE" would call <b>CoCreateInstance</b> or <b>ClassFactory::CreateInstance</b> to obtain a pointer to an object (not an interface!). Using this pointer, the client would call <i>QueryInterface</i> to obtain an interface. If the client wanted to obtain another interface, he or she would make another <i>QueryInterface</i> call <i>through the object</i>, not through the interface. You could <i>not</i> obtain an interface from another interface. Only the object would have the ability to dispense interfaces. Bye, bye <i>IUnknown</i>!
<p>Let me show you some hypothetical code in this new "smart OLE."
<hr><!--End Text-->

         <!--Yellow background-->
        <table cellpadding=10 cellspacing=0 width="100%">
                <tr>
                      <td width=20>
            	      <td bgcolor="#e0e080">
<pre><font face="courier"><!--Code-->
CoObject * obj <font color="#000099"><b>CoCreateInstance</b></font> (CLSID_FooBarObject);
IFoo * foo = obj-&gt;QueryInterface (IID_FOO);
foo-&gt;FooMethod ();
IBar * bar = obj-&gt;QueryInterface (IID_BAR);
bar-&gt;BarMethod ();
delete obj;</font></pre><!--End Code-->
                      <td width=20>
        </table>
        <!--End of yellow background-->
<hr><!--Text-->
I purposely omitted all the error checking and reference counting. In fact, I wouldn't write code like this in a serious application, I'd use smart pointers and exceptions. But notice one thing, in "smart OLE" inheritance is as simple as in C++. Since there is no way to jump from interface to interface and there is no <i>IUnknown</i>; extending <i>FooObject</i> by adding <i>IBar</i> requires no more work than having <i>FooBarObject</i> inherit from <i>FooObject</i> and <i>IBar</i>, implementing <i>IBar</i> methods and overriding the <i>QueryInterface</i> method of <i>CoObject</i>. I assume that all "smart OLE" objects inherit from the abstract class <i>CoObject</i> and override its <i>QueryInterface</i> method (it's very much different from having every interface inherit from <i>IUnknown</i>!).

<hr>

<font size="+1"><b>What about reference counting?</b></font> The truth is, there is very little need for refcounting as long as you agree not to destroy the object while you are using its interfaces. That's not such a big deal--we do it all the time when we are using methods in C++. We don't think it's an especially harsh requirement, not to destroy the object while we are using its methods. If we were to follow OLE's current model to its full extent, we should require the client to get a refcount of any method he or she is planning to use, and then release it after the call? It would be absurd, wouldn't it?

<p>So why does OLE so meticulously count references? Simple--it's because it is hiding the object from the client. The OLE object is created implicitly when you get its first interface, and destroyed implicitly when you release its last interface. You see, OLE is doing you a big favor by hiding this bookkeeping from you. Or is it? Funny you'd ask.

<hr>
<table cellpadding=10>
<tr>
<td bgcolor="#ffccff">
<font size="+1"><b>Long, long time ago</b></font>, when computer languages were still in their infancy, the wizards of C were trying to implement a stack. They made the discovery that all the client needed in order to operate a stack were two functions, <i>push</i> and <i>pop</i>. They also realized that they would have to allocate some memory to hold stack data and, since they were neat programmers, they would have to release it when the client was done. But how would they know when the client was done? Well, obviously, the client was done when he or she didn't need to call <i>push</i> or <i>pop</i> any more. Once the wizards of C realized that, the rest was simple. The stack was created and memory allocated when the client requested the first pointer to <i>push</i>. He could then call <i>push</i> with a special argument to obtain the corresponding <i>pop</i>. In fact, using the same scheme he could create as many <i>pushes</i> and <i>pops</i> as he wished. Then, when he was done with a given <i>push</i> or <i>pop</i>, he'd simply release it. Once all the <i>pushes</i> and <i>pops</i> were released, the stack would be freed. This ingeniuos scheme simplified programming tremendously, because the clients didn't have to deal with the stack itself. The system took care of all the bookkeeping. Programmers were ecstatic and they gave all their money to the wizards of C. And, by the way, the new functions were called <i>i_push</i> and <i>i_pop</i>.
</table>
<hr>
<font size="+1"><b>Here's the best part of the story.</b></font> You might think, "Oh, right, big deal! It's easy to come up with these ideas now, after OLE has been on the market for almost a decade." What if I told you that yours truly, who worked for Microsoft back then, soon after OLE 1.0 was released, had these ideas written down and sent to the responsible people. To make the long story short, the ideas were accepted as valid, but rejected on the premise that there already had been too much code written to the OLE specification (mostly at Microsoft). No manager was willing to take the risk of redesigning OLE. 
<p>So here we are now, reference counting, aggregating and all. The moral of the story is, 
	<!--Yellow background.-->
	<table cellpadding=10 cellspacing=0 width="100%">
		<tr>
		<td width=20>
            		<td bgcolor="#e0e080">
<font face="courier" color="#cc0066"><b>
There is nothing sacred about OLE. It <i>can</i> be done better!
</b></font>
		<td width=20>
	</table>
                <!--End of yellow background-->
But can we have the cake and eat it too? In other words, is it possible to build "smart OLE" on top of "the other OLE"? You bet! Go straight to the <a href="ole.html">next tutorial</a>.
<hr><!--End Text-->

<sup>1</sup>It really cracked me up when I read the introduction to the chapter on Aggregation in the otherwise fine (although somehow dorky) book "Inside COM" by Dale Rogerson. If he knew the real story, he wouldn't be so adamant in his defense of aggregation.

<!--End Text-->


   <!-- end main box -->
   </table>


   <td width=10><!-- Right margin -->
</table> <!-- End main table -->



<layer src="http://www.spidersoft.com/ads/bwz468_60.htm" visibility=hidden id=a1 width=600 onload="moveToAbsolute(ad1.pageX,ad1.pageY); a1.clip.height=60;visibility='show';"></layer>
</body>
</html>

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产剧情一区二区| www.日本不卡| 亚洲欧美福利一区二区| 91精品在线一区二区| 色综合久久久网| 国产成人精品一区二区三区四区 | 欧美成人乱码一区二区三区| 97成人超碰视| 国产成人精品亚洲777人妖| 青青草国产精品亚洲专区无| 一区二区三区四区av| 国产日韩精品一区二区三区| 日韩免费福利电影在线观看| 欧美三级中文字幕在线观看| 成人av一区二区三区| 国产一区二区0| 老司机免费视频一区二区三区| 亚洲午夜电影在线| 一二三区精品福利视频| 亚洲蜜臀av乱码久久精品蜜桃| 中文字幕电影一区| 国产日韩欧美精品一区| 亚洲精品在线免费播放| 精品久久久久99| 日韩一区二区三免费高清| 制服丝袜国产精品| 91超碰这里只有精品国产| 欧美调教femdomvk| 欧美综合视频在线观看| 色香蕉久久蜜桃| 日本乱人伦aⅴ精品| 91视频一区二区三区| 99re亚洲国产精品| 91福利精品视频| 欧美日韩一区二区三区四区五区 | 久久久久久97三级| 久久久久久黄色| 日本一区二区成人| 国产精品久久久久久久蜜臀| 亚洲天堂a在线| 亚洲精品高清在线观看| 亚洲国产你懂的| 人人狠狠综合久久亚洲| 激情综合色丁香一区二区| 国产美女娇喘av呻吟久久| 高清久久久久久| 91麻豆福利精品推荐| 欧美性受极品xxxx喷水| 这里只有精品视频在线观看| 欧美mv日韩mv国产网站app| 国产亚洲一区二区三区在线观看| 国产精品麻豆99久久久久久| 亚洲视频图片小说| 午夜电影一区二区| 极品少妇xxxx精品少妇| 不卡av免费在线观看| 欧美色视频一区| 精品日韩欧美一区二区| 国产精品久久久久一区| 亚洲大片在线观看| 精品一区二区三区免费视频| 成人精品视频网站| 欧美日韩一区二区不卡| 亚洲精品一区二区三区在线观看| 亚洲国产精品ⅴa在线观看| 亚洲精品久久久蜜桃| 欧美bbbbb| 成人不卡免费av| 8x8x8国产精品| 中文字幕乱码久久午夜不卡| 亚洲精品va在线观看| 久久成人久久爱| 一本一本大道香蕉久在线精品 | 欧美精品成人一区二区三区四区| 欧美精品一区二区三| 亚洲欧美一区二区三区国产精品| 日本欧美加勒比视频| 成人精品视频一区二区三区| 5月丁香婷婷综合| 欧美激情资源网| 日韩av一级电影| av电影在线不卡| 日韩免费电影一区| 一区二区视频在线看| 狠狠色狠狠色综合| 欧美熟乱第一页| 欧美国产成人在线| 老司机精品视频线观看86| 91农村精品一区二区在线| 精品国产一区二区三区不卡| 一区二区三区四区在线播放| 国产激情一区二区三区桃花岛亚洲| 欧美性三三影院| 亚洲三级小视频| 国产成人在线色| 欧美一级电影网站| 伊人开心综合网| 波多野结衣视频一区| 日韩美女主播在线视频一区二区三区| 亚洲欧洲精品天堂一级| 国产成人自拍网| 精品国产成人在线影院| 亚洲国产欧美日韩另类综合| 99视频国产精品| 中文字幕国产精品一区二区| 久草精品在线观看| 欧美精品精品一区| 亚洲制服丝袜一区| 色偷偷88欧美精品久久久| 国产色91在线| 国产乱子伦视频一区二区三区 | 欧美少妇bbb| 亚洲精品国产无天堂网2021| eeuss鲁片一区二区三区在线看| 2021久久国产精品不只是精品| 日韩国产精品久久久| 欧美综合天天夜夜久久| 一区二区三区av电影| 一本久久综合亚洲鲁鲁五月天| 国产精品视频观看| 国产黄人亚洲片| 国产日韩三级在线| 国产盗摄一区二区| 欧美—级在线免费片| 成人免费毛片高清视频| 中文字幕欧美日韩一区| 粉嫩蜜臀av国产精品网站| 国产肉丝袜一区二区| 国产在线精品一区二区夜色 | 一区二区三区精品在线| 色一情一乱一乱一91av| 亚洲美女区一区| 91成人网在线| 亚洲高清不卡在线观看| 欧美色图12p| 男男gaygay亚洲| 欧美xxx久久| 丁香婷婷综合色啪| 国产精品国产三级国产aⅴ入口 | 亚洲综合视频网| 欧美日韩精品一区二区天天拍小说| 亚洲国产日韩av| 91精品欧美综合在线观看最新| 美女在线视频一区| 久久久久久综合| 成人高清视频在线| 亚洲欧美日本韩国| 欧美日韩成人综合天天影院| 日韩av在线发布| 337p粉嫩大胆噜噜噜噜噜91av| 国内外成人在线视频| 中文字幕第一区第二区| 色婷婷av一区二区三区大白胸| 香蕉乱码成人久久天堂爱免费| 精品欧美乱码久久久久久| 国产精品亚洲午夜一区二区三区 | 亚洲午夜av在线| 日韩亚洲欧美在线观看| 国产不卡视频在线播放| 一区二区三区四区在线播放| 欧美一区二区三区视频在线| 国产精品一区二区久久不卡| 亚洲欧美日韩在线| 制服.丝袜.亚洲.中文.综合| 国产精品一级黄| 亚洲一二三区在线观看| 精品国产乱码久久久久久图片| 国产成人精品一区二区三区四区| 有码一区二区三区| 欧美mv日韩mv国产网站app| 99久久久精品免费观看国产蜜| 日日摸夜夜添夜夜添精品视频| 久久影院午夜论| 欧美性猛交xxxx黑人交| 国产乱码精品1区2区3区| 亚洲一二三区不卡| 久久久久成人黄色影片| 欧美专区亚洲专区| 国产一区在线精品| 亚洲高清视频在线| 日本一区二区视频在线观看| 337p亚洲精品色噜噜狠狠| 不卡的av中国片| 激情深爱一区二区| 亚洲国产综合在线| 中文一区一区三区高中清不卡| 3d成人动漫网站| 在线免费不卡电影| 国产白丝精品91爽爽久久| 日本伊人色综合网| 亚洲免费色视频| 国产欧美日韩综合| 欧美本精品男人aⅴ天堂| 在线观看国产一区二区| 国产精品羞羞答答xxdd| 日本中文字幕不卡| 亚洲综合色自拍一区| 中文字幕+乱码+中文字幕一区| 欧美电影免费观看完整版| 欧美日韩精品一二三区|