<?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[mehrfachauswahl in CFileDialog]]></title><description><![CDATA[<p>Hallo</p>
<p>Wie kann man bei einem Ladendialog (CFileDialog)mit aktivierter Mehrfachauswahl alle Dateinamen in ein CStringArray speichern? Ich habe in der MSDN geschaut und gelesen, das es mit GetStartPosition und GetNextPathName geht aber ich hab nicht genau verstanden wie man das in eine Schleife packt.</p>
<p>chrische</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/163428/mehrfachauswahl-in-cfiledialog</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Jul 2026 10:54:52 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/163428.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 29 Oct 2006 15:51:05 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to mehrfachauswahl in CFileDialog on Sun, 29 Oct 2006 15:51:05 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Wie kann man bei einem Ladendialog (CFileDialog)mit aktivierter Mehrfachauswahl alle Dateinamen in ein CStringArray speichern? Ich habe in der MSDN geschaut und gelesen, das es mit GetStartPosition und GetNextPathName geht aber ich hab nicht genau verstanden wie man das in eine Schleife packt.</p>
<p>chrische</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1163824</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1163824</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 29 Oct 2006 15:51:05 GMT</pubDate></item><item><title><![CDATA[Reply to mehrfachauswahl in CFileDialog on Sun, 29 Oct 2006 16:00:55 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">CFileDialog dlg;
...
CStringArray astrFiles;
for (POSITION pos=dlg.GetStartPosition(); pos; )
    astrFiles.Add(dlg.GetNextPathName(pos));
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1163834</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1163834</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sun, 29 Oct 2006 16:00:55 GMT</pubDate></item><item><title><![CDATA[Reply to mehrfachauswahl in CFileDialog on Sun, 29 Oct 2006 16:00:59 GMT]]></title><description><![CDATA[<p>So in etwa:</p>
<pre><code class="language-cpp">CStringArray strarray;
CFilDialog FD(...);
if(FD.DoModal() == IDOK)
{
    POSITION pos = FD.GetStartPosition( );
    while(pos != NULL)
        strarray.AddTail(FD.GetNextPathName(pos);
}
</code></pre>
<p>is nicht getestet sollte aber so laufen</p>
<p>gruß</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1163835</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1163835</guid><dc:creator><![CDATA[CTecS]]></dc:creator><pubDate>Sun, 29 Oct 2006 16:00:59 GMT</pubDate></item><item><title><![CDATA[Reply to mehrfachauswahl in CFileDialog on Sun, 29 Oct 2006 17:50:13 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Vielen Dank!</p>
<p>Das wäre vielleicht mal was für die FAQ.</p>
<p>chrische</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1163924</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1163924</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Sun, 29 Oct 2006 17:50:13 GMT</pubDate></item><item><title><![CDATA[Reply to mehrfachauswahl in CFileDialog on Mon, 30 Oct 2006 08:23:06 GMT]]></title><description><![CDATA[<p>aber wenn man vorher kein bzw zu wenig buffer reserviert wird das gar nix</p>
<pre><code class="language-cpp">const int BufferSize = 32*1024;
std::vector&lt;CString&gt;vFiles;
CFileDialog fOpen(TRUE, NULL, NULL, OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, &quot;All Files *.*|*.*&quot;, NULL, 0);
fOpen.GetOFN().nMaxFile = BufferSize;
TCHAR *tcBuffer = new TCHAR[BufferSize];
SecureZeroMemory(tcBuffer, BufferSize);
fOpen.GetOFN().lpstrFile = tcBuffer;
if(IDOK == fOpen.DoModal())
{
    POSITION pos = fOpen.GetStartPosition();
    while(pos != NULL){
        vFiles.push_back(fOpen.GetNextPathName(pos));
}
delete[] tcBuffer;
tcBuffer = NULL;
</code></pre>
<p>//edit, delete vergessen #gg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1164251</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1164251</guid><dc:creator><![CDATA[EXDW]]></dc:creator><pubDate>Mon, 30 Oct 2006 08:23:06 GMT</pubDate></item><item><title><![CDATA[Reply to mehrfachauswahl in CFileDialog on Mon, 30 Oct 2006 08:31:53 GMT]]></title><description><![CDATA[<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/20441">@Mr</a> Evil: Warum allokierst Du die 32KB vom Heap und verwendest nicht den Stack? Das spart die die Allokiererei.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1164259</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1164259</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 30 Oct 2006 08:31:53 GMT</pubDate></item><item><title><![CDATA[Reply to mehrfachauswahl in CFileDialog on Mon, 30 Oct 2006 11:54:27 GMT]]></title><description><![CDATA[<p>Martin Richter schrieb:</p>
<blockquote>
<p><a class="plugin-mentions-user plugin-mentions-a" href="https://www.c-plusplus.net/forum/uid/20441">@Mr</a> Evil: Warum allokierst Du die 32KB vom Heap und verwendest nicht den Stack? Das spart die die Allokiererei.</p>
</blockquote>
<p>einfach weil ich das so aus der MSDN hab - wuesste nicht was daran verkehrt sein sollte - nachdem es ausgelesen ist und in den vector geschmissen wirds doch eh wieder gekillt</p>
<p>was wuerdest du vorschlagen ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1164401</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1164401</guid><dc:creator><![CDATA[EXDW]]></dc:creator><pubDate>Mon, 30 Oct 2006 11:54:27 GMT</pubDate></item><item><title><![CDATA[Reply to mehrfachauswahl in CFileDialog on Mon, 30 Oct 2006 13:34:35 GMT]]></title><description><![CDATA[<p>Ist ja in Ordnung. Alerdings vermeide ich die Benutziung des Heaps, wenn es eben auch mit einer Variable auf dem Stack geht.<br />
Da CFileDialog auf dem Stack liegt hätte ich den entsprechenden Puffer auch auf den Stack gelegt.</p>
<p>Ist eine reine Stil und Geschmachsfrage:</p>
<pre><code class="language-cpp">const int BufferSize = 32*1024;
TCHAR cBuffer[BufferSize];
cBuffer[0] = _T('\0');
std::vector&lt;CString&gt; vFiles;
CFileDialog fOpen(TRUE, NULL, NULL, OFN_ALLOWMULTISELECT | OFN_HIDEREADONLY | OFN_OVERWRITEPROMPT, &quot;All Files *.*|*.*&quot;, NULL, 0);
fOpen.GetOFN().nMaxFile = BufferSize;
fOpen.GetOFN().lpstrFile = tcBuffer;
if(IDOK == fOpen.DoModal())
{
    POSITION pos = fOpen.GetStartPosition();
    while(pos != NULL){
        vFiles.push_back(fOpen.GetNextPathName(pos));
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1164465</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1164465</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 30 Oct 2006 13:34:35 GMT</pubDate></item><item><title><![CDATA[Reply to mehrfachauswahl in CFileDialog on Mon, 30 Oct 2006 15:30:09 GMT]]></title><description><![CDATA[<p>und 32 kb reichen in jedem Fall?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1164592</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1164592</guid><dc:creator><![CDATA[eeeee]]></dc:creator><pubDate>Mon, 30 Oct 2006 15:30:09 GMT</pubDate></item><item><title><![CDATA[Reply to mehrfachauswahl in CFileDialog on Mon, 30 Oct 2006 18:25:32 GMT]]></title><description><![CDATA[<p>Das musst Du Dir selbst beantworten, wieviele Namen hier returniert werden können. In der reinen Theorie kann hier unendlich viel returniert werden.</p>
<p>Aber auch hir kann man über CommDlgExtendedError und Analyse der ersten beiden Zeichen, die absolut benötigte Buffergröße ermitteln.<br />
D.h. aber auch: Mehr als 64kb geht sowieso nicht!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1164791</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1164791</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Mon, 30 Oct 2006 18:25:32 GMT</pubDate></item></channel></rss>