Skip to Content
0
Oct 20, 2005 at 03:36 PM

Menu from XML

212 Views

Hi. I suggest you a little game.

Given an XML file defining a menu :

<?xml version="1.0" encoding="UTF-8"?>

<Application>

<Menus>

<action type="add">

<Menu Checked="0" Enabled="1" FatherUID="43520" Position="13" String="Miscellaneous Demo" Type="2" UniqueID="99999">

<Menus>

<action type="add">

<Menu Checked="0" Enabled="1" FatherUID="99999" Position="0" String="Custom Form" Type="1" UniqueID="menuCustomForm" />

</action>

</Menus>

</Menu>

</action>

</Menus>

</Application>

why this code create the menu

Private Sub AddMenuItems()

Dim oXmlDoc As New MSXML2.DOMDocument

Call oXmlDoc.load("MyMenu.xml")

Call m_app.LoadBatchActions(oXmlDoc.xml)

End Sub

and this other no?

Private Sub AddMenuItems()

Dim x As XmlDocument = New System.Xml.XmlDocument

x.Load("MyMenu.xml")

m_app.LoadBatchActions(x.InnerXml)

End Sub

Who give me the answer wins my many thanks.

Ciao. Nicola