Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / General MS InfoPath Questions / September 2004

Tip: Looking for answers? Try searching our database.

Security Error in OnContextChange Event

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Michelle - 22 Sep 2004 22:30 GMT
I am trying to copy the context sensitive help example described at
http://blogs.msdn.com/philoj/archive/2004/04/25/119926.aspx

The Infopath form uses SP1 and C# and is published to a Sharepoint
Form Library.  It runs fine on my computer. However, as soon as I try
to open the Infopath form from a colleague's computer I get the
following error:

Security Error
at mySolution.OnContextChange(DocContextChangeEvent e)
at Microsoft.Office.Interop.InfoPath.SemiTrust._XDocumentEventSink2
_SinkHelper.OnContextChange(DocContextChangeEvent pEvent)

Needless to say this error is not very helpful.

What I have found is that when you look at the properties available
for thisXDocument.View.Window.TaskPanes you get Visible and
TaskPaneType.  What the example does is cast the TaskPanes item
(TaskPanes[0]) to HTMLTaskPaneObject which should make properties like
HTMLDocument and readyState available.  As soon as I try to access
these properties that are not available without the cast I get the
security error.

At this point I'm thinking the problem lies with something not being
installed on my colleague's computer.  He has InfoPath SP1 and Visual
Studio .NET installed.

Any help would truly be appreciated.

Assuming this can be resolved, the next step would be to figure out
what needs to be installed on client machines at a minimum in order to
get the InfoPath forms to work without these security errors being
bubbled up.  If someone could clearly specify those minimum
requirements that too would be appreciated.

Many thanks!
Josh Bertsch [MSFT] - 22 Sep 2004 22:51 GMT
Is the form fully trusted?

In order for onContextChange to work properly on each machine, the machine
needs to have MSHTML.dll PIA registered in the GAC.

So, make sure the latest MSHTML.dll PIA is installed in the GAC and run
"gacutil -i Microsoft.mshtml.dll" and "regasm.exe Microsoft.mshtml.dll".

That should do the trick!

--josh bertsch

> X-No-archive: yes
>
[quoted text clipped - 34 lines]
>
> Many thanks!
Michelle - 23 Sep 2004 14:54 GMT
Thanks for your quick response Josh.

The form is not fully trusted.  Our intent was to distribute the form
through a Sharepoint Forms library.

I went ahead and ran gacutil and regasm on the Microsoft.mshtml.dll,
but it had no effect.  Tried this on three different machines.
They're still getting the same error.

Is there something else that might be missing?

Regards.

> Is the form fully trusted?
>
[quoted text clipped - 44 lines]
> >
> > Many thanks!
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.