<?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>How does COM activation work anyway?</title><link>http://blogs.msdn.com/larryosterman/archive/2004/10/12/241420.aspx</link><description>One of my co-workers came to me the other day and asked why on earth COM had this "dwClsContext" parameter. In particular, he was concerned about the various CLSCTX_XXX_SERVER options. In order to explain what the point of the CLSCTX_XXX_SERVER options,</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>re: How does COM activation work anyway?</title><link>http://blogs.msdn.com/larryosterman/archive/2004/10/12/241420.aspx#241637</link><pubDate>Wed, 13 Oct 2004 08:54:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:241637</guid><dc:creator>Pavel Lebedinsky</dc:creator><description>Somewhere along the way, CoCreateInstance also consults the COM+ catalog to see if the requested CLSID has been registered there.&lt;br&gt;&lt;br&gt;I recently spent an hour trying to figure out why CoCreateInstance was returning a proxy rather than a direct pointer to some COM object that was registered with ThreadingModel=both. Then I noticed that the DLL specified in InprocServer32 wasn't even loaded into my process. Turned out this CLSID was also added to an out-of-proc COM+ application, so it was activated in a dllhost.</description></item><item><title>re: How does COM activation work anyway?</title><link>http://blogs.msdn.com/larryosterman/archive/2004/10/12/241420.aspx#241716</link><pubDate>Wed, 13 Oct 2004 13:45:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:241716</guid><dc:creator>Larry Osterman</dc:creator><description>Yeah, I left out the clsid cache from my discussion above - if someone's called CoCreateInstance in the process previously, the information is cached and re-used.&lt;br&gt;&lt;br&gt;In your case, I bet it was one of those dual in-proc and out-of-proc objects, and the first caller specified the CLSCTX_LOCAL_SERVER version, so when you came along and specified CLSCTX_INPROC_SERVER, you got the first one's information, not the one you specified.&lt;br&gt;&lt;br&gt;I don't know if that's a bug or not, to be honest, since the two versions are theoretically interchangable.&lt;br&gt;</description></item><item><title>re: How does COM activation work anyway?</title><link>http://blogs.msdn.com/larryosterman/archive/2004/10/12/241420.aspx#241936</link><pubDate>Wed, 13 Oct 2004 20:29:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:241936</guid><dc:creator>Darren Cherneski</dc:creator><description>Hey Larry, have you ever run into this?  It's along the lines of COM activation.&lt;br&gt;&lt;br&gt;Say you create an out-of-process COM server that runs as a LocalServer (as opposed to LocalService) using the ATL project wizard in VS6 or VS.NET.  Then create a console app that calls CoInitialize() and then CoCreateInstance() on an object in the COM server.  When you run the console app, you'll see the COM server startup in the Task Manager.  So far so good.  If you startup more instances of the console app, they all use the existing running instance of the COM server for their classfactory.  Again, so far so good.&lt;br&gt;&lt;br&gt;Suppose you then create a barebones service that calls CoCreateInstance() on the COM object in the server.  Whenever I do this I observe a second instance of the COM server starts up - even if I tell the service to use the same Account that started the console apps and open up the DCOM permissions on the COM server.  I've never figured out how to get a service to use a running instance of the COM server instead of firing up a second instance.&lt;br&gt;</description></item><item><title>re: How does COM activation work anyway?</title><link>http://blogs.msdn.com/larryosterman/archive/2004/10/12/241420.aspx#241941</link><pubDate>Wed, 13 Oct 2004 20:34:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:241941</guid><dc:creator>Larry Osterman</dc:creator><description>You might look at the activate as activator (AAA) stuff there.  I believe that your security blanket requires that COM servers be activated as activator (that's what the AAA stuff is).  Which means that the COM server is going to run in the context of the user that activated it, if more than one user activates the object, you get more than one server.&lt;br&gt;&lt;br&gt;I'm not sure how to disable it, you might try CLSCTX_DISABLE_AAA and see if it works (but you need to be aware that there are REALLY serious security ramifications of doing this, and I'm not sure if it'll work on XP SP2).&lt;br&gt;</description></item><item><title>re: How does COM activation work anyway?</title><link>http://blogs.msdn.com/larryosterman/archive/2004/10/12/241420.aspx#241975</link><pubDate>Wed, 13 Oct 2004 21:31:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:241975</guid><dc:creator>bg</dc:creator><description>nice one, thanks,&lt;br&gt;&lt;br&gt;perhaps you could explain the point of COM monikers, i've never really understood what use they are!&lt;br&gt;&lt;br&gt;</description></item><item><title> Larry Osterman s WebLog How does COM activation work anyway | work from home</title><link>http://blogs.msdn.com/larryosterman/archive/2004/10/12/241420.aspx#9762135</link><pubDate>Tue, 16 Jun 2009 16:18:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9762135</guid><dc:creator> Larry Osterman s WebLog How does COM activation work anyway | work from home</dc:creator><description>&lt;p&gt;PingBack from &lt;a rel="nofollow" target="_new" href="http://workfromhomecareer.info/story.php?id=11276"&gt;http://workfromhomecareer.info/story.php?id=11276&lt;/a&gt;&lt;/p&gt;
</description></item></channel></rss>