<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/"><channel><title>常春华的专栏 - COM学习</title><link>http://blog.csdn.net/chang_chunhua/category/379562.aspx</link><description>潘爱民的《COM原理和应用》</description><dc:language>zh-CN</dc:language><lastUpdateTime>Tue, 22 Apr 2008 09:45:32 GMT</lastUpdateTime><ttl>60</ttl><item><dc:creator>常春华</dc:creator><title>COM学习笔记（六）</title><link>http://blog.csdn.net/chang_chunhua/archive/2008/04/21/2312875.aspx</link><pubDate>Mon, 21 Apr 2008 18:47:00 GMT</pubDate><guid>http://blog.csdn.net/chang_chunhua/archive/2008/04/21/2312875.aspx</guid><wfw:comment>http://blog.csdn.net/chang_chunhua/comments/2312875.aspx</wfw:comment><comments>http://blog.csdn.net/chang_chunhua/archive/2008/04/21/2312875.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/chang_chunhua/comments/commentRss/2312875.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2312875</trackback:ping><description>组件是运行在分布式环境中的，如果启动组件就会遇到一个大的问题。想C++中的new函数，它有没有考虑远程的实现呢？因此启动组件，调用接口的功能，就由COM系统来实现了。

当调用组件的时候，其实是依靠代理（运行在本地）和存根（运行在远端）之间的通讯完成的。具体来说，当客户程序通过 CoCreateInstance() 函数启动组件，则代理接管该调用，它和存根通讯，存根则它所在的本地（相对于客户程序来说就是远程了）执行 new 操作加载对象。&lt;img src ="http://blog.csdn.net/chang_chunhua/aggbug/2312875.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>常春华</dc:creator><title>COM学习笔记（五）</title><link>http://blog.csdn.net/chang_chunhua/archive/2008/04/21/2312842.aspx</link><pubDate>Mon, 21 Apr 2008 18:17:00 GMT</pubDate><guid>http://blog.csdn.net/chang_chunhua/archive/2008/04/21/2312842.aspx</guid><wfw:comment>http://blog.csdn.net/chang_chunhua/comments/2312842.aspx</wfw:comment><comments>http://blog.csdn.net/chang_chunhua/archive/2008/04/21/2312842.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/chang_chunhua/comments/commentRss/2312842.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2312842</trackback:ping><description>COM 组件是运行在分布式环境中的。也就是说，这个函数可能运行在“地球另一边”的计算机上，既然运行在那么遥远的地方，就有可能出现服务器关机、网络掉线、运行超时、对方不在服务区......等异常。于是，这个加法函数，除了需要返回运算结果以外，还应该返回一个值------函数是否被正常执行了。&lt;img src ="http://blog.csdn.net/chang_chunhua/aggbug/2312842.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>常春华</dc:creator><title>COM学习笔记（四）</title><link>http://blog.csdn.net/chang_chunhua/archive/2008/04/21/2312620.aspx</link><pubDate>Mon, 21 Apr 2008 16:55:00 GMT</pubDate><guid>http://blog.csdn.net/chang_chunhua/archive/2008/04/21/2312620.aspx</guid><wfw:comment>http://blog.csdn.net/chang_chunhua/comments/2312620.aspx</wfw:comment><comments>http://blog.csdn.net/chang_chunhua/archive/2008/04/21/2312620.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/chang_chunhua/comments/commentRss/2312620.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2312620</trackback:ping><description>客户程序调用接口成员函数的过程，通过AddRef()和Release（）调用，有效地控制字典对象的生命周期，实际的使用过程中，情况要复杂的多，如果客户程序由多个人协作完成客户程序，则需要提供一般性的规则就非常重要。系统可以很好地控制组件对象。客户可以通过QueryInterface函数，可以非常灵活地在接口指针在指针接口之间来回跳转，而且不同的客户跳转的顺序是不一样的。&lt;img src ="http://blog.csdn.net/chang_chunhua/aggbug/2312620.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>常春华</dc:creator><title>COM学习笔记（三）</title><link>http://blog.csdn.net/chang_chunhua/archive/2008/04/21/2310802.aspx</link><pubDate>Mon, 21 Apr 2008 09:59:00 GMT</pubDate><guid>http://blog.csdn.net/chang_chunhua/archive/2008/04/21/2310802.aspx</guid><wfw:comment>http://blog.csdn.net/chang_chunhua/comments/2310802.aspx</wfw:comment><comments>http://blog.csdn.net/chang_chunhua/archive/2008/04/21/2310802.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/chang_chunhua/comments/commentRss/2310802.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2310802</trackback:ping><description>一个有良好习惯的C++程序员可以在长期工作中形成自己的类库，新应用的开发可以使用以前积累下来的类代码。这也是C++类重用的一个有意义的用途。

API层可以很好地把两个程序联系在一起，应用程序和组件程序通过一个平面结构的API层与字典组件进行交互。
如果客户程序要使用COM对象的某个接口，则它必须知道接口的IID和接口所提供的方法（即接口成员函数）。
&lt;img src ="http://blog.csdn.net/chang_chunhua/aggbug/2310802.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>常春华</dc:creator><title>COM学习笔记（二）</title><link>http://blog.csdn.net/chang_chunhua/archive/2008/04/17/2302164.aspx</link><pubDate>Thu, 17 Apr 2008 20:24:00 GMT</pubDate><guid>http://blog.csdn.net/chang_chunhua/archive/2008/04/17/2302164.aspx</guid><wfw:comment>http://blog.csdn.net/chang_chunhua/comments/2302164.aspx</wfw:comment><comments>http://blog.csdn.net/chang_chunhua/archive/2008/04/17/2302164.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/chang_chunhua/comments/commentRss/2302164.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2302164</trackback:ping><description>怎样来使用COM对象提供的服务呢？

客户创建对象以后，我们得到的是指向对象的某个接口的指针，然后我们就可以调用该接口提供的服务。所以对象的表现其实也就是一组接口。
&lt;img src ="http://blog.csdn.net/chang_chunhua/aggbug/2302164.aspx" width = "1" height = "1" /&gt;</description></item><item><dc:creator>常春华</dc:creator><title>COM学习笔记（一）</title><link>http://blog.csdn.net/chang_chunhua/archive/2008/04/17/2301705.aspx</link><pubDate>Thu, 17 Apr 2008 17:30:00 GMT</pubDate><guid>http://blog.csdn.net/chang_chunhua/archive/2008/04/17/2301705.aspx</guid><wfw:comment>http://blog.csdn.net/chang_chunhua/comments/2301705.aspx</wfw:comment><comments>http://blog.csdn.net/chang_chunhua/archive/2008/04/17/2301705.aspx#Feedback</comments><slash:comments>0</slash:comments><wfw:commentRss>http://blog.csdn.net/chang_chunhua/comments/commentRss/2301705.aspx</wfw:commentRss><trackback:ping>http://tb.blog.csdn.net/TrackBack.aspx?PostId=2301705</trackback:ping><description>当应用程序或者普通程序调用组件的功能时候，它首先要创建一个COM对象，或者通过其他方法调用COM对象，然后通过对象所实现的COM接口调用它所提供的服务。当所有的服务结束后，如果客户程序不再使用该COM端口，那么它应该释放掉对象所占有的空间，包括对象本身。（这是基本程序设计思想）&lt;img src ="http://blog.csdn.net/chang_chunhua/aggbug/2301705.aspx" width = "1" height = "1" /&gt;</description></item></channel></rss>