<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>API Problems: CComObject::CreateInstance</title><link>http://blogs.msdn.com/b/jaredpar/archive/2008/03/28/api-problems-ccomobject-createinstance.aspx</link><description>CComObject::CreateInstance is a light weight method for creating instances of COM objects in your code. Unfortunately the design of the API makes it easy to introduce subtle errors into your code. The two problems are it encourages manually ref counting</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: API Problems: CComObject::CreateInstance</title><link>http://blogs.msdn.com/b/jaredpar/archive/2008/03/28/api-problems-ccomobject-createinstance.aspx#8345878</link><pubDate>Mon, 31 Mar 2008 19:44:35 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8345878</guid><dc:creator>JaredPar MSFT</dc:creator><description>&lt;p&gt;Quick caveat, I've only seen the demos on shared_ptr&amp;lt;T&amp;gt; and haven't had a lot of time to play with it yet. &amp;nbsp;I think it would be hard to mix a shared_ptr&amp;lt;T&amp;gt; with a COM Ptr. &amp;nbsp;The reason being that they exist to serve two different memory management models. &amp;nbsp;&lt;/p&gt;
&lt;p&gt;shared_ptr&amp;lt;T&amp;gt; exist to add reference counting to an object which does not support it. &amp;nbsp;The actual memory management occurs via new/delet.&lt;/p&gt;
&lt;p&gt;CComPtr&amp;lt;T&amp;gt; exist to make reference counting easy on an object designed to explicitly support it. &amp;nbsp;Also CComPtr&amp;lt;T&amp;gt; does not explicitly free the memory. &amp;nbsp;Instead the underlying object does once the reference count hits 0. &amp;nbsp;COM objects can be custom implemented such that the actual memory can come from something other than new/delet. &amp;nbsp;&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8345878" width="1" height="1"&gt;</description></item><item><title>re: API Problems: CComObject::CreateInstance</title><link>http://blogs.msdn.com/b/jaredpar/archive/2008/03/28/api-problems-ccomobject-createinstance.aspx#8342884</link><pubDate>Sat, 29 Mar 2008 06:55:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8342884</guid><dc:creator>Kris</dc:creator><description>&lt;p&gt;Wondering if you could post something on TR1 that MS released a few weeks ago and how it could simplify COM pointers by leveraging the new smart ptr for instance.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8342884" width="1" height="1"&gt;</description></item></channel></rss>