Posted 16 years ago by Anton Sontheim
Avatar
Hi,
I tried to use the macro serialize functions:

m_marcoMemoryStream = New System.IO.MemoryStream
Dim w As XmlTextWriter = New XmlTextWriter(m_marcoMemoryStream, System.Text.Encoding.Unicode)
editor.MacroRecording.LastMacroCommand.WriteToXml(w)
w.Flush()

m_marcoMemoryStream.Position = 0
Dim reader As New System.Xml.XmlTextReader(m_marcoMemoryStream)
Dim macro As MacroCommand = New MacroCommand
macro.ReadFromXml(reader)
I definitly know that there are commands in the memory stream.
But macro does not contain any command after ReadFromXml().
What is wrong ?

Comments (3)

Posted 16 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Avatar
Take a look at this post:

http://www.actiprosoftware.com/Support/Forums/ViewForumTopic.aspx?ForumTopicID=932#3201

It includes the sample code I used to serialze to/from XML.
Posted 16 years ago by Anton Sontheim
Avatar
I have already seen your post.
But your code can´t be a working one (->new Macro()). Are you sure finally got commands in the macro after the ReadFromXml function?

XmlTextReader r = new XmlTextReader(memoryStream);
MacroCommand macro = new Macro();
macro.ReadFromXml(r);
Posted 16 years ago by Boyd - Sr. Software Developer, Patterson Consulting, LLC
Avatar
Sorry... that was a typo. Should be
MacroCommand macro = new MacroCommand();
I've corrected the original post.
The latest build of this product (v21.1.0) was released 13 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.