<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Tree Menü Speichern]]></title><description><![CDATA[<p>in welcher form soll man am besten ein tree menü in einer datei speichern?<br />
Das menü verändert sich oft, und ist mit CImageList bei den einträgen.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/146357/tree-menü-speichern</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Jul 2026 17:13:59 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/146357.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 07 May 2006 07:37:27 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Tree Menü Speichern on Sun, 07 May 2006 07:37:27 GMT]]></title><description><![CDATA[<p>in welcher form soll man am besten ein tree menü in einer datei speichern?<br />
Das menü verändert sich oft, und ist mit CImageList bei den einträgen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1052402</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1052402</guid><dc:creator><![CDATA[Morides]]></dc:creator><pubDate>Sun, 07 May 2006 07:37:27 GMT</pubDate></item><item><title><![CDATA[Reply to Tree Menü Speichern on Sun, 07 May 2006 13:16:29 GMT]]></title><description><![CDATA[<p>Wie wäre es wenn du das TreeMenü in einer XML Datei speicherst?<br />
<a href="http://www.codeproject.com/useritems/ctreectrl_xml.asp" rel="nofollow">http://www.codeproject.com/useritems/ctreectrl_xml.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1052637</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1052637</guid><dc:creator><![CDATA[guenni81]]></dc:creator><pubDate>Sun, 07 May 2006 13:16:29 GMT</pubDate></item><item><title><![CDATA[Reply to Tree Menü Speichern on Sun, 07 May 2006 14:22:18 GMT]]></title><description><![CDATA[<p>Danke für den Link!!!<br />
Habe den schon vor paar Tagen gefunden, und um erlich zu sein, ich komm mit dem nicht klar.<br />
Ich suche noch weiter nach einem einfachen Beispiel für XML und CTreeCtrl.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1052693</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1052693</guid><dc:creator><![CDATA[Morides]]></dc:creator><pubDate>Sun, 07 May 2006 14:22:18 GMT</pubDate></item><item><title><![CDATA[Reply to Tree Menü Speichern on Sun, 07 May 2006 15:48:00 GMT]]></title><description><![CDATA[<p>Im Prinzip musst du nur alle Treenodes durchlaufen und daraus eine XML Datei erstellen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1052747</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1052747</guid><dc:creator><![CDATA[guenni81]]></dc:creator><pubDate>Sun, 07 May 2006 15:48:00 GMT</pubDate></item><item><title><![CDATA[Reply to Tree Menü Speichern on Sun, 07 May 2006 20:50:19 GMT]]></title><description><![CDATA[<p>laden und speichern leuft jetzt, aber wie kann ich bei die icon ID auslesen und speichern?<br />
PS text wird schon gespeichert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053011</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053011</guid><dc:creator><![CDATA[Morides]]></dc:creator><pubDate>Sun, 07 May 2006 20:50:19 GMT</pubDate></item><item><title><![CDATA[Reply to Tree Menü Speichern on Sun, 07 May 2006 22:40:05 GMT]]></title><description><![CDATA[<p>Die ID des Icons kannst du über die Funktion GetItem und der Struktur TV_ITEM ermitteln.<br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_ctreectrl.3a3a.getitem.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vcmfc98/html/_mfc_ctreectrl.3a3a.getitem.asp</a><br />
<a href="http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/html/cereftv_item.asp" rel="nofollow">http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wceui40/html/cereftv_item.asp</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053051</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053051</guid><dc:creator><![CDATA[guenni81]]></dc:creator><pubDate>Sun, 07 May 2006 22:40:05 GMT</pubDate></item><item><title><![CDATA[Reply to Tree Menü Speichern on Mon, 08 May 2006 07:25:55 GMT]]></title><description><![CDATA[<p>Bekomme zwar immer noch nicht ausgelesen, aber Danke schon mal dafür!!!</p>
<p>noch eine kleine Frage.<br />
Wie kann ich bei den Tree Items zusätzliche Information hinterlegen, am besten als string, char oder int?<br />
Bei SetItemData geht es nur mit DWORD_PTR.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053134</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053134</guid><dc:creator><![CDATA[Morides]]></dc:creator><pubDate>Mon, 08 May 2006 07:25:55 GMT</pubDate></item><item><title><![CDATA[Reply to Tree Menü Speichern on Mon, 08 May 2006 07:47:10 GMT]]></title><description><![CDATA[<p>Du könntest zum Beispiel eine Extra Klasse entwerfen, die diese Informationen aufnimmt und den Adressbereich dem TreeNode mit SetItemData zuweisen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053149</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053149</guid><dc:creator><![CDATA[guenni81]]></dc:creator><pubDate>Mon, 08 May 2006 07:47:10 GMT</pubDate></item><item><title><![CDATA[Reply to Tree Menü Speichern on Mon, 08 May 2006 14:47:00 GMT]]></title><description><![CDATA[<p>kan ich leider nicht machen, da muss ich dann 2 dateien anlegen<br />
Das Treemenü wird aus einem XML File geladen, und verändert sich immer</p>
<p>PPPPPS: Hat einer ein Beispiel für GetItem um die Icon nummer auszulesen? ich bekomm es nicht ausgelesen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1053465</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053465</guid><dc:creator><![CDATA[Morides]]></dc:creator><pubDate>Mon, 08 May 2006 14:47:00 GMT</pubDate></item><item><title><![CDATA[Reply to Tree Menü Speichern on Mon, 08 May 2006 20:06:27 GMT]]></title><description><![CDATA[<p>Hier ein kleines Beispiel:</p>
<pre><code class="language-cpp">TVITEM Item;
	CString szText;
	CString szItem;

	Item.hItem = GetTreeCtrl().GetSelectedItem();
	Item.mask = TVIF_IMAGE | TVIF_TEXT;
	Item.pszText = szText.GetBuffer(100);
	Item.cchTextMax = 100;
	szText.ReleaseBuffer();

	GetTreeCtrl().GetItem(&amp;Item);

	szItem.Format(&quot;Item Text: %s, Item Image ID: %d&quot;,szText, Item.iImage);
	AfxMessageBox(szItem);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1053759</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1053759</guid><dc:creator><![CDATA[guenni81]]></dc:creator><pubDate>Mon, 08 May 2006 20:06:27 GMT</pubDate></item><item><title><![CDATA[Reply to Tree Menü Speichern on Tue, 09 May 2006 13:08:37 GMT]]></title><description><![CDATA[<p>viel viel viel Dank!!!<br />
Ich bastel im Moment an <a href="http://www.codeproject.com/useritems/ctreectrl_xml.asp" rel="nofollow">http://www.codeproject.com/useritems/ctreectrl_xml.asp</a>, was auch ein super Vorschlag von dir war.<br />
Im Moment habe ich Probleme, das ausgelesen Icon zu speichern, also dein Letzten Vorschlag hier einzubauen.</p>
<pre><code class="language-cpp">void CTreeCtrlXML::Save( TiXmlNode* a_pNode )
{
	ASSERT( NULL != a_pNode );

	TiXmlNode* pItems = a_pNode-&gt;InsertEndChild( TiXmlElement( &quot;Items&quot; ) );
	TiXmlNode* pParent = pItems;
	TiXmlNode* pNewNode = NULL;
	HTREEITEM hItem = GetRootItem();
	int iIndent = 0; int iLastIndent = 0;

	while( hItem )
	{
		iIndent = GetIndentLevel( hItem );

		int iDiff = iIndent - iLastIndent;
		if( iDiff &gt; 0 )
		{
			ASSERT( NULL != pNewNode );

			while( iDiff-- )
				pNewNode = pNewNode-&gt;InsertEndChild( TiXmlElement( &quot;Item&quot; ) );

			ASSERT( NULL != pNewNode );
			pParent = pNewNode-&gt;Parent();
		}
		else if( iDiff &lt; 0 )
		{
			iDiff--;					// Correct difference to get the right parent
			pParent = pNewNode;

			while( iDiff++ &lt; 0 )
				pParent = pParent-&gt;Parent();

			ASSERT( NULL != pParent );
			pNewNode = pParent-&gt;InsertEndChild( TiXmlElement( &quot;Item&quot; ) );
		}
		else 
		{
			ASSERT( NULL != pParent );
			pNewNode = pParent-&gt;InsertEndChild( TiXmlElement( &quot;Item&quot; ) );
		}

		iLastIndent = iIndent;			

		// Save current item
		TiXmlElement* pElement = pNewNode-&gt;ToElement();
		ASSERT( NULL != pElement );
		pElement-&gt;SetValue( &quot;Item&quot; );
		pElement-&gt;SetAttribute(&quot;Title&quot;,GetItemText(hItem));
		// The next item, please ...
		hItem = GetNextItem( hItem );
	}
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1054125</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1054125</guid><dc:creator><![CDATA[Morides]]></dc:creator><pubDate>Tue, 09 May 2006 13:08:37 GMT</pubDate></item><item><title><![CDATA[Reply to Tree Menü Speichern on Tue, 09 May 2006 17:00:28 GMT]]></title><description><![CDATA[<p>MSDN lesen...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1054305</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1054305</guid><dc:creator><![CDATA[Gromel]]></dc:creator><pubDate>Tue, 09 May 2006 17:00:28 GMT</pubDate></item><item><title><![CDATA[Reply to Tree Menü Speichern on Tue, 09 May 2006 17:52:10 GMT]]></title><description><![CDATA[<p>Morides schrieb:</p>
<blockquote>
<p>viel viel viel Dank!!!<br />
Im Moment habe ich Probleme, das ausgelesen Icon zu speichern, also dein Letzten Vorschlag hier einzubauen.</p>
</blockquote>
<p>Über den Befehl GetItem bekommst du ja die Daten in die TVITEM Struktur. Anschließend musst du die Imagenummer nur noch in der XML Datei speichern.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1054343</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1054343</guid><dc:creator><![CDATA[guenni81]]></dc:creator><pubDate>Tue, 09 May 2006 17:52:10 GMT</pubDate></item><item><title><![CDATA[Reply to Tree Menü Speichern on Tue, 09 May 2006 17:56:33 GMT]]></title><description><![CDATA[<p>Gromel schrieb:</p>
<blockquote>
<p>MSDN lesen...</p>
</blockquote>
<p>Habe ich schon gemacht, und google auch schon durch, es hat bis jetzt nur als ausgabe bei einem klick auf den Item Funktioniert.<br />
ich bekomme ies aber nicht gespeichern, in den source oben.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1054348</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1054348</guid><dc:creator><![CDATA[Morides]]></dc:creator><pubDate>Tue, 09 May 2006 17:56:33 GMT</pubDate></item><item><title><![CDATA[Reply to Tree Menü Speichern on Tue, 09 May 2006 18:07:03 GMT]]></title><description><![CDATA[<p>Bei deinem Beispeiel wird das Icon von GetSelectedItem ausgeben, ich finde oben (CTreeCtrlXML::Save) keine möglichkeit es einzubauen, dass auch funktioniert.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1054359</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1054359</guid><dc:creator><![CDATA[Morides]]></dc:creator><pubDate>Tue, 09 May 2006 18:07:03 GMT</pubDate></item><item><title><![CDATA[Reply to Tree Menü Speichern on Tue, 09 May 2006 20:02:42 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">void CTreeCtrlXML::Save( TiXmlNode* a_pNode ) 
{ 
    ASSERT( NULL != a_pNode ); 

    TiXmlNode* pItems = a_pNode-&gt;InsertEndChild( TiXmlElement( &quot;Items&quot; ) ); 
    TiXmlNode* pParent = pItems; 
    TiXmlNode* pNewNode = NULL; 
    HTREEITEM hItem = GetRootItem(); 
    int iIndent = 0; int iLastIndent = 0; 

    while( hItem ) 
    { 
        iIndent = GetIndentLevel( hItem ); 

        int iDiff = iIndent - iLastIndent; 
        if( iDiff &gt; 0 ) 
        { 
            ASSERT( NULL != pNewNode ); 

            while( iDiff-- ) 
                pNewNode = pNewNode-&gt;InsertEndChild( TiXmlElement( &quot;Item&quot; ) ); 

            ASSERT( NULL != pNewNode ); 
            pParent = pNewNode-&gt;Parent(); 
        } 
        else if( iDiff &lt; 0 ) 
        { 
            iDiff--;                    // Correct difference to get the right parent 
            pParent = pNewNode; 

            while( iDiff++ &lt; 0 ) 
                pParent = pParent-&gt;Parent(); 

            ASSERT( NULL != pParent ); 
            pNewNode = pParent-&gt;InsertEndChild( TiXmlElement( &quot;Item&quot; ) ); 
        } 
        else 
        { 
            ASSERT( NULL != pParent ); 
            pNewNode = pParent-&gt;InsertEndChild( TiXmlElement( &quot;Item&quot; ) ); 
        } 

        iLastIndent = iIndent;            

        // Save current item 
        TiXmlElement* pElement = pNewNode-&gt;ToElement(); 
        ASSERT( NULL != pElement ); 
        pElement-&gt;SetValue( &quot;Item&quot; ); 
        pElement-&gt;SetAttribute(&quot;Title&quot;,GetItemText(hItem)); 

    TVITEM Item; 
    CString szText; 
    CString szItem; 

    Item.hItem = hItem; 
    Item.mask = TVIF_IMAGE; 
    Item.pszText = szText.GetBuffer(100); 
    Item.cchTextMax = 100; 
    szText.ReleaseBuffer(); 

    pElement-&gt;GetItem(&amp;Item); 
    pElement-&gt;SetAttribute(&quot;icon&quot;,&quot;%d&quot;)

   // The next item, please ... 
        hItem = GetNextItem( hItem ); 
    } 
}
</code></pre>
<p>versuch es mal damit</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1054453</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1054453</guid><dc:creator><![CDATA[Xcion]]></dc:creator><pubDate>Tue, 09 May 2006 20:02:42 GMT</pubDate></item><item><title><![CDATA[Reply to Tree Menü Speichern on Wed, 10 May 2006 01:06:52 GMT]]></title><description><![CDATA[<p>kommt ein fehler</p>
<pre><code class="language-cpp">c:\Run\ccddf\TreeCtrlXML.cpp(149): error C2039: 'GetItem': Ist kein Element von 'TiXmlElement'
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1054534</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1054534</guid><dc:creator><![CDATA[Morides]]></dc:creator><pubDate>Wed, 10 May 2006 01:06:52 GMT</pubDate></item><item><title><![CDATA[Reply to Tree Menü Speichern on Wed, 10 May 2006 06:18:18 GMT]]></title><description><![CDATA[<p>Morides schrieb:</p>
<blockquote>
<p>kommt ein fehler</p>
<pre><code class="language-cpp">c:\Run\ccddf\TreeCtrlXML.cpp(149): error C2039: 'GetItem': Ist kein Element von 'TiXmlElement'
</code></pre>
</blockquote>
<p>GetItem ist ein Element von CTreeCtrl, also mach das pElement vorne mal weg.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1054578</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1054578</guid><dc:creator><![CDATA[guenni81]]></dc:creator><pubDate>Wed, 10 May 2006 06:18:18 GMT</pubDate></item><item><title><![CDATA[Reply to Tree Menü Speichern on Wed, 10 May 2006 12:04:45 GMT]]></title><description><![CDATA[<p>Danke euch, es leuft, bin weiter am SetItemData am basteln!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1054783</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1054783</guid><dc:creator><![CDATA[Morides]]></dc:creator><pubDate>Wed, 10 May 2006 12:04:45 GMT</pubDate></item></channel></rss>