Hello Everyone,
My infopath form has a button in which you can click it and give a number , that number is the number of "clones" or copies of an infopath node to add to the XML (in a repeating section). When the user clicks this "clone" button they enter the number and then my code behind loops as many times as they've requested and inserts the node that many times into the repeating section. This works great however if the user requests to clone a node 10 times i get the followign error... is there anything i can do here to fix this? I should also mention that i am using infopath 2007 and hosting the form in a 2005 windows form. The code that actually does this is inside my windows form.
Thanks!
{"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."}
[System.AccessViolationException]: {"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."}
Data: {System.Collections.ListDictionaryInternal}
HelpLink: null
InnerException: null
Message: "Attempted to read or write protected memory. This is often an indication that other memory is corrupt."
Source: "Microsoft.Office.InfoPath.Client.Internal.Host.Interop"
StackTrace: " at Microsoft.MsoOffice.InfoPath.MsxmlInterop.NativeHelpers.InsertBefore(Char* , IXMLDOMNode* , IXMLDOMDocument3* )\r\n at Microsoft.MsoOffice.InfoPath.MsxmlInterop.MsxmlNodeImpl.InsertBefore(String strXml, MsxmlNode refChild)\r\n at Microsoft.Office.InfoPath.MsxmlWriter.Close()\r\n at System.Xml.XmlWellFormedWriter.Close()\r\n at System.Xml.XPath.XPathNavigator.InsertAfter(XmlReader newSibling)\r\n at System.Xml.XPath.XPathNavigator.InsertAfter(String newSibling)\r\n at DataCollectionClient.frmDataCollection.NotifyHostEventHandler(Object sender, String notification) in C:\\_dev\\Tablet-Exterior\\Data Collection Application\\DataCollectionClient\\ExternalInspection.cs:line 828"
TargetSite: {Int32 Microsoft.MsoOffice.InfoPath.MsxmlInterop.NativeHelpers.InsertBefore(Char*, IXMLDOMNode*, IXMLDOMDocument3*)}