青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

隨筆 - 42  文章 - 3  trackbacks - 0
<2025年11月>
2627282930311
2345678
9101112131415
16171819202122
23242526272829
30123456

常用鏈接

留言簿(2)

隨筆檔案

文章檔案

網(wǎng)頁收藏

搜索

  •  

最新評論

閱讀排行榜

評論排行榜

Recently, I have read Inside COM, it is not my first time to read it. But still I got some useful information from it.

First of all, rather than inheriting, Containment and Aggregation are the two methods COM used to achieve reusability.
Aggregation is the specialized form of Containment, in which the programmer doesn’t have to implement code in the outer component to forward/delegate a call to the inner component and hence makes the life of a programmer easier. In Aggregation, the outer component hands over the control of the interface, which is being implemented by the inner component, to the client directly and the outer component gets out of the picture. In Aggregation, the interface to the inner component is exposed directly to the client, which is in contrast with the Containment. The outer IUnknown and the Inner IUnknown will be having the different implementation of the QueryInterface and hence it violates the basic QueryInterface rules. To forward/delegate calls to the outer IUnknown, the inner component needs the outer component’s IUnknown interface pointer. The outer component passes its IUnknown interface pointer at the time of creating the inner component. The outer component calls CoCreateInstance and passes its IUnknown pointer in the second argument of CoCreateInstance. If this parameter is non-NULL, then the component is being aggregated, otherwise the component is not aggregated.

Secondly, The IDispatch interface was initially designed to support Automation. It provides a late-binding mechanism to access and retrieve information about an object's methods and properties.In addition to the methods inherited from IUnknown, server developers must implement the following methods within the class definition of each object that is exposed:
  • GetTypeInfoCount returns the number of type descriptions for the object. For objects that support IDispatch, the type information count is always one.
  • GetTypeInfo retrieves a description of the object's programmable interface.
  • GetIDsOfNames maps the name of a method or property to a DISPID, which is later used to invoke the method or property.
  • Invoke calls one of the object's methods, or gets or sets one of its properties.

When the client need to call the method provide by the server, and the code is like this:

 

 1HRESULT hret=CoInitialize(NULL); assert(SUCCEEDED(hret));
 2    CComPtr<IDispatch> ptr;
 3
 4    ptr.CoCreateInstance(L"InternetExplorer.Application");
 5      if(ptr==0{ wprintf(L"Unable to create Application\n"); return 1; }
 6    
 7    wchar_t *array=L"GoHome";
 9    long id;
10    hret=ptr->GetIDsOfNames(IID_NULL,&array,1,LOCALE_SYSTEM_DEFAULT,&id);
11    assert(SUCCEEDED(hret));
12    
13    DISPPARAMS noparams;  memset(&noparams,0,sizeof(noparams));
14    
15    hret=ptr->Invoke(id,IID_NULL,LOCALE_SYSTEM_DEFAULT,DISPATCH_METHOD,&noparams,NULL,NULL,NULL);   
18    CoUninitialize();    return 0;
19

Third, Connection Points, Com’s Observer Pattern
-Based on Callbacks
-COM-Object can have one or more event sources
-Per event source may be one or more subscribed event sink
-asynchronous communication between a server and its clients

//Client
class myEventSink : public EventSink
{
 void handleEvent(int arg)
 { cout << “myEventHandler” << arg << endl; }
};

//Server
[ object, uuid(…) }
interface IEventSource : IUnknown
{
 HRESULT Attach( [in] IEventSink* PEveSink);
};

Protocol
IConnectionPointContainer::FindConnectionPoint
IConnectionPoint::Advise       //passing sink interface pointer, receiving cookie
IConnectionPoint::Unadvice    //terminates notification

 

posted on 2012-03-04 22:08 鷹擊長空 閱讀(1255) 評論(0)  編輯 收藏 引用

只有注冊用戶登錄后才能發(fā)表評論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲网在线观看| 国产日韩成人精品| 国产婷婷色一区二区三区| 亚洲一区在线播放| 一本色道久久综合狠狠躁篇怎么玩| 欧美一级大片在线免费观看| 国产精品免费观看在线| 亚洲一区二区三区涩| 性色av一区二区三区| 欧美亚洲视频一区二区| 欧美午夜激情小视频| 亚洲女人天堂av| 欧美mv日韩mv国产网站| 欧美日韩直播| 亚洲日本欧美| 亚洲经典视频在线观看| 久久九九国产精品怡红院| 久久精品国产久精国产爱| 国产精品视频精品| 亚洲小视频在线观看| 亚洲免费视频网站| 国产精品分类| 亚洲图片自拍偷拍| 午夜一区在线| 国产欧美日韩一区二区三区在线观看 | 黄色一区三区| 午夜视频久久久久久| 性色av一区二区三区| 国产精品亚洲综合天堂夜夜| 在线视频你懂得一区| 亚洲一区黄色| 国产精品伦一区| 亚洲女性裸体视频| 久久精品综合网| 经典三级久久| 免费观看在线综合| 亚洲精品国偷自产在线99热| 夜夜嗨一区二区三区| 欧美日韩亚洲免费| 亚洲一区在线免费| 久久久久久有精品国产| 国产在线欧美日韩| 久久人体大胆视频| 亚洲日本视频| 午夜精品一区二区三区四区| 国产视频一区在线观看一区免费| 久久国产精品亚洲77777| 欧美成人午夜激情在线| 日韩性生活视频| 欧美亚洲成人免费| 欧美一区二区三区啪啪| 欧美大香线蕉线伊人久久国产精品| 亚洲精品国产精品国自产在线| 欧美日韩国产成人在线91| 一区二区三区国产盗摄| 久久视频精品在线| 亚洲免费av片| 国产情人节一区| 女同一区二区| 亚洲欧美精品一区| 欧美国产日韩一二三区| 亚洲婷婷免费| 1024成人| 国产精品乱人伦中文| 老司机精品导航| 亚洲一区二区三区影院| 亚洲电影在线播放| 欧美在线免费一级片| 亚洲精品久久嫩草网站秘色| 国产日韩av高清| 欧美日韩午夜在线| 久久深夜福利| 性色av一区二区三区| 亚洲精品乱码久久久久久| 久久亚洲精品伦理| 亚洲自拍偷拍网址| 亚洲精品免费一二三区| 国产在线日韩| 国产精品羞羞答答| 欧美日韩精品在线观看| 久久综合狠狠综合久久激情| 午夜精品福利在线观看| 99国产精品一区| 亚洲高清av| 裸体素人女欧美日韩| 欧美一区二区三区电影在线观看| 夜夜嗨av色综合久久久综合网| 一区二区三区亚洲| 国产夜色精品一区二区av| 国产精品红桃| 欧美日韩精品综合| 欧美极品在线观看| 免费在线视频一区| 噜噜噜久久亚洲精品国产品小说| 欧美一区在线直播| 性娇小13――14欧美| 亚洲在线免费| 亚洲欧美日本另类| 亚洲一区二区精品| 国产精品99久久久久久有的能看| 最新日韩在线视频| 91久久中文| 亚洲精品影院| 亚洲精选在线| 一本大道久久a久久精品综合| 亚洲欧洲日本一区二区三区| 亚洲东热激情| 亚洲人成绝费网站色www| 亚洲国产专区校园欧美| 亚洲国产天堂久久综合网| 欧美国产日韩免费| 亚洲国产成人av好男人在线观看| 欧美激情精品久久久六区热门| 女人天堂亚洲aⅴ在线观看| 欧美a级一区二区| 欧美激情第五页| 亚洲经典自拍| 在线一区二区三区做爰视频网站| 在线视频亚洲| 亚洲欧美综合一区| 久久久久久久久久看片| 美脚丝袜一区二区三区在线观看 | 亚洲九九精品| 亚洲精品在线视频| 亚洲夜晚福利在线观看| 午夜欧美电影在线观看| 久久精品视频亚洲| 欧美jjzz| 在线视频欧美精品| 欧美一区久久| 男女视频一区二区| 欧美日韩在线视频首页| 欧美性猛交xxxx免费看久久久 | 亚洲欧洲精品一区二区精品久久久| 亚洲欧洲日本一区二区三区| 亚洲视频一区| 久久久91精品| 欧美激情精品久久久| 国产精品久久久久久久久久妞妞| 国产亚洲精品一区二区| 亚洲国产高潮在线观看| 亚洲一区二区三区四区视频| 欧美中文字幕视频在线观看| 欧美成人一区二区三区片免费| 亚洲精品视频在线观看免费| 亚洲欧美日韩精品久久久| 免费成人高清在线视频| 国产精品一香蕉国产线看观看| 亚洲承认在线| 亚洲欧美视频在线观看视频| 男人的天堂亚洲| 亚洲视频网站在线观看| 久久最新视频| 国产美女精品视频免费观看| 亚洲国产一区二区三区青草影视| 午夜精品999| 亚洲国产综合在线看不卡| 亚洲欧美影院| 欧美日韩国产一区二区| 有码中文亚洲精品| 欧美一区二区三区在线播放| 亚洲人成在线观看| 久久免费视频这里只有精品| 国产精品夜夜夜| 99精品欧美一区二区蜜桃免费| 久久人人97超碰国产公开结果| 一本综合久久| 欧美激情精品久久久久久| 精久久久久久| 久久激情视频久久| 亚洲综合色噜噜狠狠| 欧美视频久久| 日韩午夜精品| 欧美激情一区二区三区蜜桃视频| 欧美与黑人午夜性猛交久久久| 国产精品jizz在线观看美国 | 亚洲国产另类精品专区| 久久九九国产精品| 亚洲综合社区| 国产精品久久久久久久久久久久久久 | 欧美日韩综合| 一区二区三区精品在线| 亚洲狠狠婷婷| 欧美阿v一级看视频| 精品成人a区在线观看| 久久久久久电影| 欧美一二区视频| 国产亚洲一区在线| 久久精品免费| 香蕉视频成人在线观看| 国产乱人伦精品一区二区| 亚洲欧美日韩一区二区三区在线观看 | 亚洲天堂黄色| 亚洲精品一区二区三区99| 欧美—级a级欧美特级ar全黄| 最近中文字幕mv在线一区二区三区四区| 久久久999精品视频| 久久狠狠亚洲综合| 尤物yw午夜国产精品视频| 欧美www在线|