A teammate used my program to create an XML file which includes several serialized diagrams. He emailed the XML file to a couple of us, both with Windows 7, 64-bit laptops.
Both of my teammates can load and display the diagram in the file. And I have created and loaded other diagrams on my laptop with no problem. When I tried to load the problem diagram, the diagram LoadSoap method generated a memory exception:
System.AccessViolationException
{"Attempted to read or write protected memory. This is often an indication that other memory is corrupt."}
I've attached the diagram XML string that generated the error message. I also created a similar diagram on my own laptop, and attached it for comparison. But I don't really know what to look for.
Suggestions? I need a way to verify/correct/prevent this file problem.
Code snippets for save and load are below (syncfusion version 9.3):
***Save Snippet***
Using strm As IO.MemoryStream = New IO.MemoryStream()
Try
Canvas.SaveSoap(strm)
strm.Position = 0
Dim reader As New IO.StreamReader(strm)
mapString = reader.ReadToEnd
Catch ex As Exception
msgbox(ex.Message)
End Try
RaiseEvent Canvas_Changed(DiagramUID, mapString)
End Using
***Load Snippet***
Protected Friend Function LoadDiagram(ByVal diagramXML As String) As Boolean
Dim result As Boolean = False
Try
Dim buf() As Byte = Encoding.UTF8.GetBytes(diagramXML)
Dim strm As IO.MemoryStream = New IO.MemoryStream(buf)
If strm.Length = 0 Then Exit Try
Dim ex1 As New Exception
Canvas.LoadSoap(strm, ex1)
If IsNothing(ex1) Then
result = True
Else
msgbox(ex1.Message)
End If
Catch ex As Exception
msgbox(ex.Message)
End Try
Return result
End Function
loadsoapfile_6e2a4ab7.zip