G
GreatWhiteStark
Ok. Here is my problem:
I have a winform application that needs to open infopath. The XML from the
InfoPath form must never touch a hard disk due to security reasons.
As I have it right now, the winform application decrypts the xml to a
previously saved form. I then open the form using the
"NewFromSolutionWithData()" function to open up the form containing the
supplied decrypted data.
No problems so far....Works like a charm.
Then I try to make the form a "Fully Trusted" form because other features of
the form access functionality on outside .dlls.
The moment that I make the form a "Fully Trusted" form and try to run the
functionality mentioned above I get a "COMInterop" Exception. Here is a
simplified version of the code that causes the error mentioned above:
Dim infoPathApp As New InfoPath.Application()
Dim xDocCollection As InfoPath.XDocumentsCollection
xDocCollection = infoPathApp.XDocuments
Dim xDoc As InfoPath.XDocument
Dim templateLocation As String = "C:\Documents and Settings\Jared
Stark\My Documents\Visual Studio
2005\Projects\InfoPathTest\TestInfoPathForm\manifest.xsf"
Dim testData As String
testData = "<?xml version=""1.0""
encoding=""UTF-8""?><?mso-infoPathSolution name=""urn:InfoPathTest:Stark""
href=""manifest.xsf"" solutionVersion=""1.0.0.2""
productVersion=""11.0.8034"" PIVersion=""1.0.0.0"" ?><?mso-application
progid=""InfoPath.Document""?><my:myFields
xmlns:my=""http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-09-25T14-36-33""
xmlns:xd=""http://schemas.microsoft.com/office/infopath/2003""><myrospectName>Jared Stark</myrospectName></my:myFields>"
Dim dom As New MyInterop.MSXML5.DOMDocument()
dom.loadXML(testData)
xDoc = xDocCollection.NewFromSolutionWithData(dom, templateLocation)
I have a winform application that needs to open infopath. The XML from the
InfoPath form must never touch a hard disk due to security reasons.
As I have it right now, the winform application decrypts the xml to a
previously saved form. I then open the form using the
"NewFromSolutionWithData()" function to open up the form containing the
supplied decrypted data.
No problems so far....Works like a charm.
Then I try to make the form a "Fully Trusted" form because other features of
the form access functionality on outside .dlls.
The moment that I make the form a "Fully Trusted" form and try to run the
functionality mentioned above I get a "COMInterop" Exception. Here is a
simplified version of the code that causes the error mentioned above:
Dim infoPathApp As New InfoPath.Application()
Dim xDocCollection As InfoPath.XDocumentsCollection
xDocCollection = infoPathApp.XDocuments
Dim xDoc As InfoPath.XDocument
Dim templateLocation As String = "C:\Documents and Settings\Jared
Stark\My Documents\Visual Studio
2005\Projects\InfoPathTest\TestInfoPathForm\manifest.xsf"
Dim testData As String
testData = "<?xml version=""1.0""
encoding=""UTF-8""?><?mso-infoPathSolution name=""urn:InfoPathTest:Stark""
href=""manifest.xsf"" solutionVersion=""1.0.0.2""
productVersion=""11.0.8034"" PIVersion=""1.0.0.0"" ?><?mso-application
progid=""InfoPath.Document""?><my:myFields
xmlns:my=""http://schemas.microsoft.com/office/infopath/2003/myXSD/2006-09-25T14-36-33""
xmlns:xd=""http://schemas.microsoft.com/office/infopath/2003""><myrospectName>Jared Stark</myrospectName></my:myFields>"
Dim dom As New MyInterop.MSXML5.DOMDocument()
dom.loadXML(testData)
xDoc = xDocCollection.NewFromSolutionWithData(dom, templateLocation)