<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Using a 32bit COM object in a 64bit environment</title>
	<atom:link href="http://www.gfi.com/blog/32bit-object-64bit-environment/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.gfi.com/blog/32bit-object-64bit-environment/?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=32bit-object-64bit-environment</link>
	<description>Brought to you by GFI Software</description>
	<lastBuildDate>Fri, 13 Sep 2013 13:27:20 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	
	<item>
		<title>By: Christian Fries</title>
		<link>http://www.gfi.com/blog/32bit-object-64bit-environment/comment-page-1/#comment-32088</link>
		<dc:creator>Christian Fries</dc:creator>
		<pubDate>Mon, 09 Apr 2012 07:58:04 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfi.com/blog/?p=1111#comment-32088</guid>
		<description><![CDATA[Windows 7 changed the way 32 bit keys are reflected in the registry. I left this in a longer comment here , but some how the comment was deleted. Maybe it was considered spam (was linking to my page). I have some details in my blog (which also links back to this page).

However, you can make this work under Win 7, but it should be noted, that this workaround is sometimes not needed. The problems with 32bit / 64bit registry stuff is often that you use a 32 bit application to register a 64 bit assembly - this does not work since 32 bit applications do not see 64 bit registry by default.]]></description>
		<content:encoded><![CDATA[<p>Windows 7 changed the way 32 bit keys are reflected in the registry. I left this in a longer comment here , but some how the comment was deleted. Maybe it was considered spam (was linking to my page). I have some details in my blog (which also links back to this page).</p>
<p>However, you can make this work under Win 7, but it should be noted, that this workaround is sometimes not needed. The problems with 32bit / 64bit registry stuff is often that you use a 32 bit application to register a 64 bit assembly &#8211; this does not work since 32 bit applications do not see 64 bit registry by default.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Kyle</title>
		<link>http://www.gfi.com/blog/32bit-object-64bit-environment/comment-page-1/#comment-30997</link>
		<dc:creator>Kyle</dc:creator>
		<pubDate>Wed, 28 Dec 2011 16:08:27 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfi.com/blog/?p=1111#comment-30997</guid>
		<description><![CDATA[Has anyone for whom this hack hasn&#039;t worked found out an alternate solution?

I&#039;m trying to use CoCreateInstance on a Visual SourceSafe DLL.]]></description>
		<content:encoded><![CDATA[<p>Has anyone for whom this hack hasn&#8217;t worked found out an alternate solution?</p>
<p>I&#8217;m trying to use CoCreateInstance on a Visual SourceSafe DLL.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mathi</title>
		<link>http://www.gfi.com/blog/32bit-object-64bit-environment/comment-page-1/#comment-29997</link>
		<dc:creator>Mathi</dc:creator>
		<pubDate>Thu, 27 Oct 2011 12:29:17 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfi.com/blog/?p=1111#comment-29997</guid>
		<description><![CDATA[Hi Emmanuel,

The registry hack solution is not working for me. I&#039;m getting the following error

&quot;Unable to cast COM object of type &#039;NewAtlProjectLib.InmAtlsimpleobject1Class&#039; to interface type &#039;NewAtlProjectLib.IInmAtlsimpleobject1&#039;. This operation failed because the QueryInterface call on the COM component for the interface with IID &#039;{0D5A58FA-5C0E-4AC1-9064-9C5A2C51FD55}&#039; failed due to the following error: Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG)).&quot;

My environment details are
Building com objects --&gt; C++ 32 bit DLL
Wrapper DLL --&gt; C# 64bit dll
Client application --&gt; C# 64 bit windows application
Build environment --&gt;W2K8 SP2 + VS2008

The client application function is
public int samplefunction(int val)
        {
InmAtlsimpleobject1Class c1 = new InmAtlsimpleobject1Class(); //here succeeds
            int val1 = c1.DoSomething(); //here failed with above error
            return val;
        }

Please suggest. Any other change is registry entry required ?

Thanks
Mathi]]></description>
		<content:encoded><![CDATA[<p>Hi Emmanuel,</p>
<p>The registry hack solution is not working for me. I&#8217;m getting the following error</p>
<p>&#8220;Unable to cast COM object of type &#8216;NewAtlProjectLib.InmAtlsimpleobject1Class&#8217; to interface type &#8216;NewAtlProjectLib.IInmAtlsimpleobject1&#8242;. This operation failed because the QueryInterface call on the COM component for the interface with IID &#8216;{0D5A58FA-5C0E-4AC1-9064-9C5A2C51FD55}&#8217; failed due to the following error: Class not registered (Exception from HRESULT: 0&#215;80040154 (REGDB_E_CLASSNOTREG)).&#8221;</p>
<p>My environment details are<br />
Building com objects &#8211;&gt; C++ 32 bit DLL<br />
Wrapper DLL &#8211;&gt; C# 64bit dll<br />
Client application &#8211;&gt; C# 64 bit windows application<br />
Build environment &#8211;&gt;W2K8 SP2 + VS2008</p>
<p>The client application function is<br />
public int samplefunction(int val)<br />
        {<br />
InmAtlsimpleobject1Class c1 = new InmAtlsimpleobject1Class(); //here succeeds<br />
            int val1 = c1.DoSomething(); //here failed with above error<br />
            return val;<br />
        }</p>
<p>Please suggest. Any other change is registry entry required ?</p>
<p>Thanks<br />
Mathi</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Emmanuel Carabott</title>
		<link>http://www.gfi.com/blog/32bit-object-64bit-environment/comment-page-1/#comment-29644</link>
		<dc:creator>Emmanuel Carabott</dc:creator>
		<pubDate>Tue, 13 Sep 2011 10:56:03 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfi.com/blog/?p=1111#comment-29644</guid>
		<description><![CDATA[I am sorry to hear you&#039;re having trouble with this. Seems like a lot of people are having trouble with this work around on Windows 7.

Most probably Microsoft changed something in Windows 7 that disabled this workaround. What error are you experiencing? Is it the same as Tobias was experiencing above? And, did you try the same process I suggested to him?]]></description>
		<content:encoded><![CDATA[<p>I am sorry to hear you&#8217;re having trouble with this. Seems like a lot of people are having trouble with this work around on Windows 7.</p>
<p>Most probably Microsoft changed something in Windows 7 that disabled this workaround. What error are you experiencing? Is it the same as Tobias was experiencing above? And, did you try the same process I suggested to him?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sandeep</title>
		<link>http://www.gfi.com/blog/32bit-object-64bit-environment/comment-page-1/#comment-29642</link>
		<dc:creator>Sandeep</dc:creator>
		<pubDate>Tue, 13 Sep 2011 06:14:38 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfi.com/blog/?p=1111#comment-29642</guid>
		<description><![CDATA[Dear emmanuel, i am using windows 7.I created COM dll in win32 and followed process suggested by you ,but it is not working for me.Let me know your mail ID if possible then will send you code to analyze.
i am calling COM as

IClassFactory *pclsf;
	IUnknown *pUnk;
	IStepfile *pstep;
	int x,y;
	long result;
	CoInitialize(NULL);
	HRESULT hr= CoGetClassObject(STEPFILE_CLSID,CLSCTX_INPROC,NULL,IID_IClassFactory,(void**)&amp;pclsf);
	hr = pclsf-&gt;CreateInstance(NULL,IID_IUnknown,(void**)&amp;pUnk);
	hr=pUnk-&gt;QueryInterface(IID_IStepfile,(void**)&amp;pstep);
	result = pstep-&gt;AddNum(1,2);]]></description>
		<content:encoded><![CDATA[<p>Dear emmanuel, i am using windows 7.I created COM dll in win32 and followed process suggested by you ,but it is not working for me.Let me know your mail ID if possible then will send you code to analyze.<br />
i am calling COM as</p>
<p>IClassFactory *pclsf;<br />
	IUnknown *pUnk;<br />
	IStepfile *pstep;<br />
	int x,y;<br />
	long result;<br />
	CoInitialize(NULL);<br />
	HRESULT hr= CoGetClassObject(STEPFILE_CLSID,CLSCTX_INPROC,NULL,IID_IClassFactory,(void**)&amp;pclsf);<br />
	hr = pclsf-&gt;CreateInstance(NULL,IID_IUnknown,(void**)&amp;pUnk);<br />
	hr=pUnk-&gt;QueryInterface(IID_IStepfile,(void**)&amp;pstep);<br />
	result = pstep-&gt;AddNum(1,2);</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tobias</title>
		<link>http://www.gfi.com/blog/32bit-object-64bit-environment/comment-page-1/#comment-29505</link>
		<dc:creator>Tobias</dc:creator>
		<pubDate>Fri, 12 Aug 2011 09:19:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfi.com/blog/?p=1111#comment-29505</guid>
		<description><![CDATA[Hello Emmanuel,

thanks for your quick reply. I used as flag &quot;CLSCTX_LOCAL_SERVER&quot; and &quot;CLSCTX_ACTIVATE_32_BIT_SERVER&quot; and also tried only one of them but nothing changed.
&quot;CoCreateInstance&quot; will return &quot;CLASS_NOT_REGISTERED&quot;. In this article (http://msdn.microsoft.com/en-us/library/aa384253%28v=VS.85%29.aspx) they specified why reflection would be disabled.

Have you run 32-bit-surrogation in this way with Windows 7?

Regards,

Tobias]]></description>
		<content:encoded><![CDATA[<p>Hello Emmanuel,</p>
<p>thanks for your quick reply. I used as flag &#8220;CLSCTX_LOCAL_SERVER&#8221; and &#8220;CLSCTX_ACTIVATE_32_BIT_SERVER&#8221; and also tried only one of them but nothing changed.<br />
&#8220;CoCreateInstance&#8221; will return &#8220;CLASS_NOT_REGISTERED&#8221;. In this article (<a href="http://msdn.microsoft.com/en-us/library/aa384253%28v=VS.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/aa384253%28v=VS.85%29.aspx</a>) they specified why reflection would be disabled.</p>
<p>Have you run 32-bit-surrogation in this way with Windows 7?</p>
<p>Regards,</p>
<p>Tobias</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Emmanuel Carabott</title>
		<link>http://www.gfi.com/blog/32bit-object-64bit-environment/comment-page-1/#comment-29501</link>
		<dc:creator>Emmanuel Carabott</dc:creator>
		<pubDate>Thu, 11 Aug 2011 14:46:56 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfi.com/blog/?p=1111#comment-29501</guid>
		<description><![CDATA[Hi Tobias, 

I didn&#039;t run into your problem so this might not work, but none the less worth a shot I guess. Did you try setting the CLSCTX_LOCAL_SERVER flag for dwClsContext in the CoCreateInstance Call?

This should theoretically force the com to use the localservice key which according to your link is reflected. Might work, definitely worth a shot.]]></description>
		<content:encoded><![CDATA[<p>Hi Tobias, </p>
<p>I didn&#8217;t run into your problem so this might not work, but none the less worth a shot I guess. Did you try setting the CLSCTX_LOCAL_SERVER flag for dwClsContext in the CoCreateInstance Call?</p>
<p>This should theoretically force the com to use the localservice key which according to your link is reflected. Might work, definitely worth a shot.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Tobias</title>
		<link>http://www.gfi.com/blog/32bit-object-64bit-environment/comment-page-1/#comment-29500</link>
		<dc:creator>Tobias</dc:creator>
		<pubDate>Thu, 11 Aug 2011 12:10:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfi.com/blog/?p=1111#comment-29500</guid>
		<description><![CDATA[Hello,

I tried this for my COM DLL but it does not work for DLL surrogation. According to this article (http://msdn.microsoft.com/en-us/library/aa384235%28v=VS.85%29.aspx) all registry keys which includes InProcServer32-IDs are not reflected because Microsoft assumes that these are only InProc-Calls and not Out-Of-Proc-Calls. A CoCreateInstance-Call would return &quot;CLASS_NOT_REGISTERED&quot; because it does not find the key in the 64-bit section.

Has anybody an idea how to get reflected the key with using of DLL surrogation?]]></description>
		<content:encoded><![CDATA[<p>Hello,</p>
<p>I tried this for my COM DLL but it does not work for DLL surrogation. According to this article (<a href="http://msdn.microsoft.com/en-us/library/aa384235%28v=VS.85%29.aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/aa384235%28v=VS.85%29.aspx</a>) all registry keys which includes InProcServer32-IDs are not reflected because Microsoft assumes that these are only InProc-Calls and not Out-Of-Proc-Calls. A CoCreateInstance-Call would return &#8220;CLASS_NOT_REGISTERED&#8221; because it does not find the key in the 64-bit section.</p>
<p>Has anybody an idea how to get reflected the key with using of DLL surrogation?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Rachel</title>
		<link>http://www.gfi.com/blog/32bit-object-64bit-environment/comment-page-1/#comment-29308</link>
		<dc:creator>Rachel</dc:creator>
		<pubDate>Fri, 01 Jul 2011 20:50:39 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfi.com/blog/?p=1111#comment-29308</guid>
		<description><![CDATA[Hi,


I made the registry changes, but I now receive the following error:

Retrieving the COM class factory for component with CLSID [class guid] failed due to the following error: 80070005.

Anything I missed?

Thanks,
Rachel]]></description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>I made the registry changes, but I now receive the following error:</p>
<p>Retrieving the COM class factory for component with CLSID [class guid] failed due to the following error: 80070005.</p>
<p>Anything I missed?</p>
<p>Thanks,<br />
Rachel</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Aaron</title>
		<link>http://www.gfi.com/blog/32bit-object-64bit-environment/comment-page-1/#comment-29160</link>
		<dc:creator>Aaron</dc:creator>
		<pubDate>Tue, 17 May 2011 21:30:28 +0000</pubDate>
		<guid isPermaLink="false">http://www.gfi.com/blog/?p=1111#comment-29160</guid>
		<description><![CDATA[This is not *quite* working for me.  CoCreateInstance returns a pointer and S_OK, I can see dllhost launched and running with my GUID, but QueryInterface returns E_NOINTERFACE.]]></description>
		<content:encoded><![CDATA[<p>This is not *quite* working for me.  CoCreateInstance returns a pointer and S_OK, I can see dllhost launched and running with my GUID, but QueryInterface returns E_NOINTERFACE.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

 Served from: www.gfi.com @ 2013-09-15 04:04:19 by W3 Total Cache --