<?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: Fully Trusted Forms</title><link>https://www.infopathdev.com:443/forums/thread/13390.aspx</link><pubDate>Wed, 27 Jul 2005 05:14:36 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13390</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13390.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13390</wfw:commentRss><description>Hi Rob,&lt;br /&gt;PIA is the Program Interop Assembly for MSHTML so that you can call it from C# or VB.NET. If you installed this on your machine but not on others, it would explain the problem. This is similar to not installing the .NET Framework, but the error is a bit obtuse. Anyway, this MSHTML PIA for InfoPath .NET solutions has been blogged elsewhere. You should check that. It might not be the issue, but since you are calling code in script, you will need it.&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Re: Fully Trusted Forms</title><link>https://www.infopathdev.com:443/forums/thread/13389.aspx</link><pubDate>Tue, 26 Jul 2005 08:01:59 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13389</guid><dc:creator>robmir</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13389.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13389</wfw:commentRss><description>Hi,&lt;br /&gt;&lt;br /&gt;thanks for reply.&lt;br /&gt;&lt;br /&gt;so I have added a reference in the project to Microsoft.mshtml.&lt;br /&gt;And in my OnContextChange handler I have written:&lt;br /&gt;&lt;pre&gt;&lt;br /&gt;if (e.Type == "ContextNode")&lt;br /&gt;{&lt;br /&gt;   string aLoc=e.Context.nodeName;&lt;br /&gt;   aLoc=aLoc.Replace("my:", "");&lt;br /&gt;   HTMLTaskPaneObject taskPane=(HTMLTaskPaneObject)thisXDocument.View.Window.TaskPanes[0];&lt;br /&gt;   mshtml.HTMLWindow2Class window=(mshtml.HTMLWindow2Class)taskPane.HTMLDocument.Script;&lt;br /&gt;   window.execScript("waitForContext('" + aLoc + "')", "JScript");&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;@Patrick Halstead: I don`t know, what do You mean by "PIA".&lt;br /&gt;&lt;br /&gt;my second problem is, that I can`t use COM - Component on other computer. I have registered the templet with RegForm.exe (registration tool). With digital certificate and settings it´s all ok but it won't work. &lt;br /&gt;&lt;br /&gt;I keep getting an error message:&lt;br /&gt;&lt;br /&gt;"&lt;font color="red"&gt;System.NullReferenceException&lt;br /&gt;Object reference not set to an instance of an object.&lt;br /&gt;   at InfoPathProject1.InfoPathProject1.&lt;b&gt;OnLoad&lt;/b&gt;(DocReturnEvent e) in c:\documents and settings\uid11518\desktop\infopathproject1\formcode.cs:line 604&lt;br /&gt;   at Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper.OnLoad(DocReturnEvent pEvent)&lt;/font id="red"&gt;"&lt;br /&gt;&lt;br /&gt;this is &lt;b&gt;OnLoad&lt;/b&gt; handler &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;public void OnLoad(DocReturnEvent e)&lt;br /&gt;{&lt;br /&gt;   try&lt;br /&gt;  {&lt;br /&gt;	cForm = new CodeForm(this);  // I create new instance from Form here &lt;br /&gt;	addGUI = new GUI4ADDClass(); // I call COM - Component&lt;br /&gt;	bOK = addGUI.OpenConnection("","PROD",false);&lt;br /&gt;  }&lt;br /&gt;  catch(Exception e)&lt;br /&gt; {&lt;br /&gt;	this.thisXDocument.UI.Alert(f.ToString());&lt;br /&gt; }&lt;br /&gt;}&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;in other words on my computer it work and on other computer It won't work.&lt;br /&gt;&lt;br /&gt;I would be glad to have your explanation&lt;br /&gt;&lt;br /&gt;robmir&lt;br /&gt;</description></item><item><title>Re: Fully Trusted Forms</title><link>https://www.infopathdev.com:443/forums/thread/13388.aspx</link><pubDate>Tue, 26 Jul 2005 06:27:50 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:13388</guid><dc:creator>Patrick Halstead</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/13388.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=13388</wfw:commentRss><description>Hi Robmir,&lt;br /&gt;Are you using some special PIA for accessing the MSHTML code in the taskpane? If so, you'll have to instal this with the solution on the clients. Just guessing ...&lt;br /&gt;&lt;br /&gt;Patrick Halstead [InfoPath MVP]&lt;br /&gt;InfoPathDev</description></item><item><title>Fully Trusted Forms</title><link>https://www.infopathdev.com:443/forums/thread/12508.aspx</link><pubDate>Mon, 25 Jul 2005 13:05:00 GMT</pubDate><guid isPermaLink="false">033a2e2d-04e2-4a9d-be01-a4634161eefd:12508</guid><dc:creator>robmir</dc:creator><slash:comments>0</slash:comments><comments>https://www.infopathdev.com:443/forums/thread/12508.aspx</comments><wfw:commentRss>https://www.infopathdev.com:443/forums/commentrss.aspx?SectionID=45&amp;PostID=12508</wfw:commentRss><description>Hallo,&lt;br /&gt;&lt;br /&gt;I develop a form and I have made the form fully trusted with script because I use InfoPath 2003 Toolkit for Visual Studio .NET and access COM components and ActiveX controls. &lt;br /&gt;&lt;pre&gt;&lt;br /&gt;Dim objIP&lt;br /&gt;Set objIP = CreateObject("InfoPath.ExternalApplication")&lt;br /&gt;objIP.RegisterSolution ("blabla")&lt;br /&gt;MsgBox ("The InfoPath form template has been registered.")&lt;br /&gt;Set objIP = Nothing&lt;br /&gt;&lt;/pre&gt;&lt;br /&gt;It`s ok.&lt;br /&gt;on my computer run the form ok, but I published the form on web server and when I try to start the form from other computer I keep getting an error message:&lt;br /&gt;&lt;br /&gt;"&lt;font color="red"&gt;System.IO.FileNotFoundException&lt;br /&gt;File or assembly name Microsoft.mshtml, or one of its dependencies, was not found.&lt;br /&gt;   at InfoPathProject1.InfoPathProject1.OnContextChange(DocContextChangeEvent e)&lt;br /&gt;   at Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2_SinkHelper.OnContextChange(DocContextChangeEvent pEvent)&lt;/font id="red"&gt;"&lt;br /&gt;&lt;br /&gt;AND for Context Sensitive Help (I did it how: &lt;a href='http://blogs.msdn.com/philoj/archive/2004/04/25/119926.aspx' target='_blank' title='http://blogs.msdn.com/philoj/archive/2004/04/25/119926.aspx'&lt;a target="_blank" href=http://blogs.msdn.com/philoj/archive/2004/04/25/119926.aspx&gt;http://blogs.msdn.com/philoj/archive/2004/04/25/119926.aspx&lt;/a&gt;&lt;/a&gt;):&lt;br /&gt;&lt;br /&gt;"&lt;font color="red"&gt;File or assembly name Microsoft.mshtml, or one of its dependencies, was not found.&lt;br /&gt;at InfoPathProject1.InfoPathProject1.OnContextChange(...)&lt;br /&gt;at Microsoft.Office.Interop.Infopath.SemiTrust._XDocumentEventSink2&lt;br /&gt;_SinkHelper.OnContextChange(blabla)&lt;/font id="red"&gt;"  &lt;br /&gt;&lt;br /&gt;Can you help me?</description></item></channel></rss>