<?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>You had me at "Hello World" : com interop</title><link>http://blogs.msdn.com/helloworld/archive/tags/com+interop/default.aspx</link><description>Tags: com interop</description><dc:language>en</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>ActiveX component can't create object, when creating a 32-COM object in a 64-bit machine</title><link>http://blogs.msdn.com/helloworld/archive/2007/12/12/activex-component-can-t-create-object-when-creating-a-32-com-object-in-a-64-bit-machine.aspx</link><pubDate>Wed, 12 Dec 2007 10:26:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:6743514</guid><dc:creator>HelloWorld</dc:creator><slash:comments>8</slash:comments><comments>http://blogs.msdn.com/helloworld/comments/6743514.aspx</comments><wfw:commentRss>http://blogs.msdn.com/helloworld/commentrss.aspx?PostID=6743514</wfw:commentRss><description>&lt;P&gt;I had two posts to resolve an issue with applications that use a 32-bit COM object in a 64-bit OS. Workaround for &lt;A href="https://blogs.msdn.com/helloworld/archive/2007/04/12/x86-com-interop-in-x64-environment.aspx" mce_href="https://blogs.msdn.com/helloworld/archive/2007/04/12/x86-com-interop-in-x64-environment.aspx"&gt;executable&lt;/A&gt;, and &lt;A href="https://blogs.msdn.com/helloworld/archive/2007/07/14/using-x86-com-interop-with-asp-net-application-in-windows-x64.aspx" mce_href="https://blogs.msdn.com/helloworld/archive/2007/07/14/using-x86-com-interop-with-asp-net-application-in-windows-x64.aspx"&gt;ASP.Net&lt;/A&gt;.&lt;/P&gt;
&lt;P&gt;I recently helped someone who had the same problem, but with a VB Script application, executed with cscript.exe. This VB script application uses a 32-bit COM object and failed to run on a 64-bit OS. The error, Microsoft VBScript runtime error: ActiveX component can't create object: 'XXXXXX'.&lt;/P&gt;
&lt;P&gt;To fix the issue, the script must be executed with the right executable. There are two cscript.exe in the 64-bit OSes. One is located at %WINDOWS%\System32, and the second one is located at %WINDOWS%\SysWOW64.&lt;/P&gt;
&lt;P&gt;The one under System32, is a 64-bit version. The one under SysWOW64 is the 32-bit version. Run the VBS application using the 32-bit application.&lt;/P&gt;
&lt;P&gt;Why System32 contains 64-bit binaries, and SysWOW64 contains 32-bit is another story, but there is a very good reason behind it, backward compatibility. :)&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=6743514" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/helloworld/archive/tags/64-bit/default.aspx">64-bit</category><category domain="http://blogs.msdn.com/helloworld/archive/tags/com+interop/default.aspx">com interop</category><category domain="http://blogs.msdn.com/helloworld/archive/tags/.Net+Framework/default.aspx">.Net Framework</category></item><item><title>Using X86 COM interop with ASP.Net application in Windows x64</title><link>http://blogs.msdn.com/helloworld/archive/2007/07/14/using-x86-com-interop-with-asp-net-application-in-windows-x64.aspx</link><pubDate>Sat, 14 Jul 2007 05:51:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:3858602</guid><dc:creator>HelloWorld</dc:creator><slash:comments>3</slash:comments><comments>http://blogs.msdn.com/helloworld/comments/3858602.aspx</comments><wfw:commentRss>http://blogs.msdn.com/helloworld/commentrss.aspx?PostID=3858602</wfw:commentRss><description>&lt;P&gt;It has been almost two months since my last post. It has been very busy here..&lt;/P&gt;
&lt;P&gt;I got several good notes with one my previous &lt;A class="" title="x86 COM Interop in x64 Environment" href="http://blogs.msdn.com/controlpanel/blogs/Retrieving%20the%20COM%20class%20factory%20for%20component%20with%20CLSID%20%7BGUID%20HERE%7D%20failed%20due%20to%20the%20following%20error:%2080040154." mce_href="http://blogs.msdn.com/controlpanel/blogs/Retrieving the COM class factory for component with CLSID {GUID HERE} failed due to the following error: 80040154."&gt;post&lt;/A&gt;, about using x86 COM interop in x64 environment. I also had few questions about using x86 COM interop with ASP.Net application in the 64-bit Windows, such as Windows Server 2003 x64, or Vista x64.&lt;/P&gt;
&lt;P&gt;Well, IIS in 64-bit Windows is also 64-bit and uses 64-bit version of .Net Framework. You might deployed your app as pre-compiled binaries or deploying the source, either way, the same error will be thrown in the app is using a 32-bit COM interop. The same error, Retrieving the COM class factory for component with CLSID {GUID HERE} failed due to the following error: 80040154.&lt;/P&gt;
&lt;P&gt;If you deployed the ASP.Net source code to the server, ASP.Net does the compilation and it is more challenging to force ASP.Net to compile it as 32-bit application, as the IIS itself is 64-bit.&lt;/P&gt;
&lt;P&gt;There is a way to do it, I don't say that this is ideal, but it works.&lt;/P&gt;
&lt;OL&gt;
&lt;LI&gt;Configure IIS to run 32-bit ASP.Net application.&lt;BR&gt;&lt;A href="http://technet2.microsoft.com/WindowsServer/en/library/140077b8-8c96-49b0-be17-e47095983c2b1033.mspx?mfr=true"&gt;http://technet2.microsoft.com/WindowsServer/en/library/140077b8-8c96-49b0-be17-e47095983c2b1033.mspx?mfr=true&lt;/A&gt;&lt;/LI&gt;
&lt;LI&gt;Register ASP.Net 32-bit with IIS.&lt;BR&gt;Open a command-prompt&amp;nbsp;window at&amp;nbsp;%windows%\Microsoft.Net\Framework\v2.0.50727 and call aspnet_regiis -i.&lt;/LI&gt;
&lt;LI&gt;Enable the 32-bit ASP.Net web service extension from IIS Service Manager&amp;nbsp;(it is not automatically enabled from step 2).&lt;/LI&gt;&lt;/OL&gt;
&lt;P&gt;Your ASP.Net application and your 32-bit COM interop now will work. The most ideal situation would be to get the 64-bit version of the COM interop.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=3858602" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/helloworld/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/helloworld/archive/tags/ASP.Net/default.aspx">ASP.Net</category><category domain="http://blogs.msdn.com/helloworld/archive/tags/Windows+Vista/default.aspx">Windows Vista</category><category domain="http://blogs.msdn.com/helloworld/archive/tags/64-bit/default.aspx">64-bit</category><category domain="http://blogs.msdn.com/helloworld/archive/tags/com+interop/default.aspx">com interop</category><category domain="http://blogs.msdn.com/helloworld/archive/tags/.Net+Framework/default.aspx">.Net Framework</category></item><item><title>x86 COM Interop in x64 Environment.</title><link>http://blogs.msdn.com/helloworld/archive/2007/04/12/x86-com-interop-in-x64-environment.aspx</link><pubDate>Thu, 12 Apr 2007 20:44:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:2102316</guid><dc:creator>HelloWorld</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/helloworld/comments/2102316.aspx</comments><wfw:commentRss>http://blogs.msdn.com/helloworld/commentrss.aspx?PostID=2102316</wfw:commentRss><description>&lt;P&gt;I encountered a problem with one of my application. It stops working when I executed it on Windows 2003 Server 64-bit. It threw an exception: &lt;/P&gt;
&lt;P&gt;Retrieving the COM class factory for component with CLSID {GUID HERE} failed due to the following error: 80040154.&lt;/P&gt;
&lt;P&gt;The COM interop is an x86 interop, and that causes the exception. To address this issue, I have to recompile the app and change the target platform from AnyCPU to x86. After that, it works great.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=2102316" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/helloworld/archive/tags/Programming/default.aspx">Programming</category><category domain="http://blogs.msdn.com/helloworld/archive/tags/64-bit/default.aspx">64-bit</category><category domain="http://blogs.msdn.com/helloworld/archive/tags/com+interop/default.aspx">com interop</category><category domain="http://blogs.msdn.com/helloworld/archive/tags/.Net+Framework/default.aspx">.Net Framework</category></item></channel></rss>