<?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>Multithreading in InfoPath</title><link>https://www.infopathdev.com:443/forums/thread/40505.aspx</link><pubDate>Fri, 10 Apr 2009 11:51:39 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:40505</guid><dc:creator>SjoukjeZaal</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/40505.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=40505</wfw:commentRss><description>&lt;p&gt;Hi,&lt;/p&gt;
&lt;p&gt;I&amp;#39;m using Visual Studio 2008 for creating a InfoPath template (C#).&lt;/p&gt;
&lt;p&gt;I&amp;#39;ve&amp;nbsp;created a datasource for submitting the form and I use that datasource in the FormSubmit eventhandler in my code. After the form is submitted to SharePoint I wan&amp;#39;t InfoPath to close. Not only close the form, but close the eintire application. I use the following code for closing InfoPath:&lt;/p&gt;
&lt;p&gt;thisApplication.ActiveWindow.Close(true);&lt;/p&gt;
&lt;p&gt;This code closes InfoPath like I wan&amp;#39;t it to but there is a problem. This code is executed before the submit event is finished. And InfoPath prompts me to&amp;nbsp;save changes&amp;nbsp;to the template. I&amp;#39;ve tried to use MultiThreading in my&amp;nbsp;code but this is not working.&amp;nbsp;I can&amp;#39;t use the above code in a new thread.&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Any suggestions anyone?&lt;/p&gt;
&lt;p&gt;Regards, Sjoukje&lt;/p&gt;</description></item></channel></rss>