<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="https://www.infopathdev.com:443/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>Code</title><link>https://www.infopathdev.com:443/forums/45.aspx</link><description /><dc:language>en</dc:language><generator>CommunityServer 2007 SP3 (Build: 31118.962)</generator><item><title>Re: InfoPath Form Control crashes on 64-bit OS</title><link>https://www.infopathdev.com:443/forums/thread/43153.aspx</link><pubDate>Thu, 18 Jun 2009 18:13:34 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43153</guid><dc:creator>TCSCdpr</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43153.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=43153</wfw:commentRss><description>&lt;p&gt;Problem resolved (or at least avoided).&lt;/p&gt;
&lt;p&gt;A 64-bit OS can create an app domain that runs in EITHER 32-bit OR 64-bit mode.&amp;nbsp; The two modes can not be mixed in a single app domain.&amp;nbsp; So when the application that hosts InfoPath is built using the &amp;quot;Any CPU&amp;quot; configuration, a 64-bit OS loads it into a 64-bit app domain.&amp;nbsp; Microsoft provides only 32-bit Interop assemblies for InfoPath, so the CoCreateInstance fails, since no native 64-bit assembly is registered.&lt;/p&gt;
&lt;p&gt;Therefore, we can wait for Microsoft to provide native X64 interop DLL&amp;#39;s (doubtful) or coerce the 64-bit OS to load the host application into a 32-bit app domain.&lt;/p&gt;
&lt;p&gt;Change the build configuration to X86 and rebuild the application.&amp;nbsp; This forces the OS to load the hosting app into a 32-bit app domain where the 32-bit InfoPath interop DLL&amp;#39;s feel right at home.&lt;/p&gt;
&lt;p&gt;Dave&lt;/p&gt;</description></item><item><title>InfoPath Form Control crashes on 64-bit OS</title><link>https://www.infopathdev.com:443/forums/thread/43110.aspx</link><pubDate>Thu, 18 Jun 2009 00:59:01 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:43110</guid><dc:creator>TCSCdpr</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/43110.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=43110</wfw:commentRss><description>&lt;p&gt;We have been using the InfoPath Form Control successfully on Windows XP and Vista 32-bit machines quite a bit.&amp;nbsp; But when we run the same application on a 64-bit machine, it crashes at the end of the control initialization when the ActiveX control attempts to create the InfoPath instance.&lt;/p&gt;
&lt;p&gt;I downloaded the Microsoft InfoPath Form Control sample application (InfoPath2007UsingIOLECommands_RTM) here: &lt;a href="http://www.microsoft.com/downloads/details.aspx?FamilyId=F65C20DF-ADC2-446A-8FBC-D7C5ED5DD83F&amp;amp;displaylang=en"&gt;http://www.microsoft.com/downloads/details.aspx?FamilyId=F65C20DF-ADC2-446A-8FBC-D7C5ED5DD83F&amp;amp;displaylang=en&lt;/a&gt;.&amp;nbsp; The Microsoft sample app crashes in exactly the same place with the same error.&amp;nbsp; But InfoPath itself (the application) runs fine in the same context.&lt;/p&gt;
&lt;p&gt;&lt;u&gt;What&amp;#39;s causing the InfoPath Form Control to crash on a 64-bit platform?&lt;/u&gt;&lt;/p&gt;
&lt;p&gt;System.Runtime.InteropServices.COMException was unhandled&lt;br /&gt;&amp;nbsp; Message=&amp;quot;Class not registered (Exception from HRESULT: 0x80040154 (REGDB_E_CLASSNOTREG))&amp;quot;&lt;br /&gt;&amp;nbsp; Source=&amp;quot;System.Windows.Forms&amp;quot;&lt;br /&gt;&amp;nbsp; ErrorCode=-2147221164&lt;br /&gt;&amp;nbsp; StackTrace:&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;System.Windows.Forms.UnsafeNativeMethods.CoCreateInstance&lt;/font&gt;(Guid&amp;amp; clsid, Object punkOuter, Int32 context, Guid&amp;amp; iid)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.AxHost.CreateWithoutLicense(Guid clsid)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.AxHost.CreateWithLicense(String license, Guid clsid)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.AxHost.CreateInstanceCore(Guid clsid)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.AxHost.CreateInstance()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.AxHost.GetOcxCreate()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.AxHost.TransitionUpTo(Int32 state)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.AxHost.CreateHandle()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;font style="BACKGROUND-COLOR:#ffff00;"&gt;at System.Windows.Forms.AxHost.EndInit()&lt;/font&gt;&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at HostedApplication.MainForm.InitializeComponent() in C:\Projects\Infopath2007\InfoPath2007UsingIOLECommands_RTM\HostedApplication\MainForm.designer.cs:line 1440&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at HostedApplication.MainForm..ctor(String[] args) in C:\Projects\Infopath2007\InfoPath2007UsingIOLECommands_RTM\HostedApplication\MainForm.cs:line 64&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at HostedApplication.Program.Main(String[] args) in C:\Projects\Infopath2007\InfoPath2007UsingIOLECommands_RTM\HostedApplication\Program.cs:line 17&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; at System.Threading.ThreadHelper.ThreadStart()&lt;br /&gt;&amp;nbsp; InnerException: &lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>