<?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 control und CFileFind]]></title><description><![CDATA[<p>ich habe ein Tree Control und möchte darin die ordnerstruktur ab einem unterordner wiedergeben wobei jeder Ordner ein (&quot;Root-Element&quot;) und jede datei ein (&quot;Child-Element&quot;) darstellen soll.</p>
<p>Ich weiss zwar wie man mit CFileFind umgeht aber bisher habe ich immer nur ein Verzeichnis wiedergegeben.</p>
<p>Aber ich habe keinen Plan wie ich das jetzt Verschachteln muss?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/152199/tree-control-und-cfilefind</link><generator>RSS for Node</generator><lastBuildDate>Thu, 23 Jul 2026 19:56:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/152199.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 04 Jul 2006 08:44:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Tree control und CFileFind on Tue, 04 Jul 2006 08:44:50 GMT]]></title><description><![CDATA[<p>ich habe ein Tree Control und möchte darin die ordnerstruktur ab einem unterordner wiedergeben wobei jeder Ordner ein (&quot;Root-Element&quot;) und jede datei ein (&quot;Child-Element&quot;) darstellen soll.</p>
<p>Ich weiss zwar wie man mit CFileFind umgeht aber bisher habe ich immer nur ein Verzeichnis wiedergegeben.</p>
<p>Aber ich habe keinen Plan wie ich das jetzt Verschachteln muss?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1091034</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1091034</guid><dc:creator><![CDATA[Skippy]]></dc:creator><pubDate>Tue, 04 Jul 2006 08:44:50 GMT</pubDate></item><item><title><![CDATA[Reply to Tree control und CFileFind on Tue, 04 Jul 2006 08:58:49 GMT]]></title><description><![CDATA[<p>Ich habe keine Ahnung wie man ein CTreeCtrl benutzt, aber wie du die Dateien und Unterodner und all das Zeugs bekommst ist relativ einfach.</p>
<pre><code class="language-cpp">CFileFind FileFinder;
CString strFind;
BOOL BFind;
CStringArray FolderArray;
FolderArray.Add(_T(&quot;Irgendein Pfad zu einem Grundverzeichnis&quot;));

while(FolderArray.GetCount() &gt; 0)
{
    strFind = m_FolderArray.GetAt(0);
    strFind += _T(&quot;\\*.*&quot;);
    BFind = FileFinder.FindFile(strFind);

    while(BFind)
    {
        BFind = FileFinder.FindNextFile();
        if(FileFinder.IsDirectory())
        {
            if(!FileFinder.IsDots())
            {
                FolderArray.Add(FileFinder.GetFilePath);
                // Ordner sonst noch wo speicher für das CTreeCtrl;
            }
        }
        else
        {
            // Das File speichern für das CTreeCtrl;
        }
    }

    FolderArray.RemoveAt(0);
}
</code></pre>
<p>Hoffe das kann dir ein wenig weiterhelfen. Man kann das natürlich auch anderst lösen, denn so gibt es ein wenig ein Durcheinander, was das Suchergebnis betrifft.</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1091048</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1091048</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Tue, 04 Jul 2006 08:58:49 GMT</pubDate></item><item><title><![CDATA[Reply to Tree control und CFileFind on Tue, 04 Jul 2006 09:46:41 GMT]]></title><description><![CDATA[<p>na beim CTreeCtrl hat man das problem das man sich merken muss wo man ist hoffe folgender Codeschnipsel zeigt das Problem</p>
<pre><code class="language-cpp">HTREEITEM iroot= NULL, iroot2= NULL;

iroot= m_cTreeIndex.InsertItem(&quot;Root 1&quot;);
       m_cTreeIndex.InsertItem(&quot;child 1.1&quot;, iroot);
	iroot2=	m_cTreeIndex.InsertItem(&quot;Root 2&quot;, iroot);
		m_cTreeIndex.InsertItem(&quot;child 2.1&quot;, iroot2);
		m_cTreeIndex.InsertItem(&quot;child 2.2&quot;, iroot2);
		m_cTreeIndex.InsertItem(&quot;child 2.3&quot;, iroot2);
       m_cTreeIndex.InsertItem(&quot;chield 1.2&quot;, iroot);
</code></pre>
<p>Irgendwie muss man sich ja dann die ganze zeit merken wo man ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1091088</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1091088</guid><dc:creator><![CDATA[Skippy]]></dc:creator><pubDate>Tue, 04 Jul 2006 09:46:41 GMT</pubDate></item><item><title><![CDATA[Reply to Tree control und CFileFind on Tue, 04 Jul 2006 11:00:48 GMT]]></title><description><![CDATA[<p>Wo ist da ein Problem?</p>
<pre><code class="language-cpp">CTreeCtrl ctrlTree; // Das CTreeCtrl Objekt.
CFileFind FileFinder; 
CString strFind;
HTREEITEM hTreeItem;
BOOL BFind; 
CStringArray FolderArray; 
CArray&lt;HTREEITEM, HTREEITEM&gt; TreeItemArray;
FolderArray.Add(_T(&quot;Irgendein Pfad zu einem Grundverzeichnis&quot;));
TreeItemArray.Add(ctrlTree.InsertAt(FolgerArray.GetAt(0)));

while(FolderArray.GetCount() &gt; 0) 
{ 
    strFind = m_FolderArray.GetAt(0); 
    strFind += _T(&quot;\\*.*&quot;); 
    BFind = FileFinder.FindFile(strFind); 

    hTreeItem = TreeItemArray.GetAt(0);

    while(BFind) 
    { 
        BFind = FileFinder.FindNextFile(); 
        if(FileFinder.IsDirectory()) 
        { 
            if(!FileFinder.IsDots()) 
            { 
                FolderArray.Add(FileFinder.GetFilePath()); 
                TreeItemArray.Add(ctrlTree.InsertAt(FileFinder.GetFileTitle(), hTreeItem));
            } 
        } 
        else 
        { 
            ctrlTree.InsertAt(FileFinder.GetFileName(), hTreeItem);
        } 
    } 

    FolderArray.RemoveAt(0); 
    TreeItemArray.RemoveAt(0);
}
</code></pre>
<p>Der Code ist nicht getestet und ich habe nur die Angaben aus der MSDN und von dir, aber so in etwa sollte es doch gehen. Nicht?</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1091131</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1091131</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Tue, 04 Jul 2006 11:00:48 GMT</pubDate></item></channel></rss>