<?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[GetOpenFileName mit OFN_ALLOWMULTISELECT]]></title><description><![CDATA[<p>Heiho</p>
<p>ich kann ohne probleme ein verzeichnis auslesen und alle dateien anzeigen lassen</p>
<p>aber ich hab ein problem damit wenn ich selber mehere dateien auswaehle, das ich alle aufliste</p>
<pre><code class="language-cpp">void COwnClass::OnBrowseFiles(){
	int BufferSize = 32*1024;
	OPENFILENAME ofn;
	ZeroMemory(&amp;ofn, sizeof(OPENFILENAME));
	ofn.lStructSize = sizeof (OPENFILENAME);
	ofn.hwndOwner = m_hWnd;
	ofn.lpstrFilter = _T(&quot;All files (*.*)&quot;);
	TCHAR *tcBuffer = new TCHAR[BufferSize];
	SecureZeroMemory(tcBuffer, BufferSize);
	ofn.lpstrFile = tcBuffer;
	ofn.nMaxFile = BufferSize;
	_tstring folder = settings.DefaultFolder();
	ofn.lpstrInitialDir = folder.c_str();
	ofn.Flags = OFN_EXPLORER|OFN_ALLOWMULTISELECT|OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST;
	if(GetOpenFileName(&amp;ofn)==TRUE){
		WIN32_FIND_DATA FindFileData;
		HANDLE hFind = FindFirstFile(ofn.lpstrFile+ofn.nFileOffset, &amp;FindFileData);
		m_lcList.AddItem(FindFileData.cFileName);
		m_lcList.AddSubItem(1, FindFileData.cFileName);

		while(FindNextFile(hFind, &amp;FindFileData) != 0){
			m_lcList.AddItem(FindFileData.cFileName);
			m_lcList.AddSubItem(1, FindFileData.cFileName);
		}
		FindClose(hFind);
	} 
}
</code></pre>
<p>bei einer einzelnen datei klappt es problemlos, aber sobald ich mehere auswaehle bekomm ich immer nur die letzte ausgewaehlte datei</p>
<p>zu huelf</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/175835/getopenfilename-mit-ofn_allowmultiselect</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 11:47:05 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/175835.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 14 Mar 2007 14:57:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to GetOpenFileName mit OFN_ALLOWMULTISELECT on Wed, 14 Mar 2007 14:57:33 GMT]]></title><description><![CDATA[<p>Heiho</p>
<p>ich kann ohne probleme ein verzeichnis auslesen und alle dateien anzeigen lassen</p>
<p>aber ich hab ein problem damit wenn ich selber mehere dateien auswaehle, das ich alle aufliste</p>
<pre><code class="language-cpp">void COwnClass::OnBrowseFiles(){
	int BufferSize = 32*1024;
	OPENFILENAME ofn;
	ZeroMemory(&amp;ofn, sizeof(OPENFILENAME));
	ofn.lStructSize = sizeof (OPENFILENAME);
	ofn.hwndOwner = m_hWnd;
	ofn.lpstrFilter = _T(&quot;All files (*.*)&quot;);
	TCHAR *tcBuffer = new TCHAR[BufferSize];
	SecureZeroMemory(tcBuffer, BufferSize);
	ofn.lpstrFile = tcBuffer;
	ofn.nMaxFile = BufferSize;
	_tstring folder = settings.DefaultFolder();
	ofn.lpstrInitialDir = folder.c_str();
	ofn.Flags = OFN_EXPLORER|OFN_ALLOWMULTISELECT|OFN_FILEMUSTEXIST|OFN_PATHMUSTEXIST;
	if(GetOpenFileName(&amp;ofn)==TRUE){
		WIN32_FIND_DATA FindFileData;
		HANDLE hFind = FindFirstFile(ofn.lpstrFile+ofn.nFileOffset, &amp;FindFileData);
		m_lcList.AddItem(FindFileData.cFileName);
		m_lcList.AddSubItem(1, FindFileData.cFileName);

		while(FindNextFile(hFind, &amp;FindFileData) != 0){
			m_lcList.AddItem(FindFileData.cFileName);
			m_lcList.AddSubItem(1, FindFileData.cFileName);
		}
		FindClose(hFind);
	} 
}
</code></pre>
<p>bei einer einzelnen datei klappt es problemlos, aber sobald ich mehere auswaehle bekomm ich immer nur die letzte ausgewaehlte datei</p>
<p>zu huelf</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1245515</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1245515</guid><dc:creator><![CDATA[EXDW]]></dc:creator><pubDate>Wed, 14 Mar 2007 14:57:33 GMT</pubDate></item><item><title><![CDATA[Reply to GetOpenFileName mit OFN_ALLOWMULTISELECT on Wed, 14 Mar 2007 16:19:57 GMT]]></title><description><![CDATA[<p>Das mit ner Dateienumeration zu lösen, ist doch irgendwie unsinnig: Da weißt Du doch gar nicht, was der Benutzer markiert hat und was nicht ?! Machs einfach so:</p>
<pre><code class="language-cpp">// ...

TCHAR szSelectedFile[(MAX_PATH * 100) + 1];
OPENFILENAME ofnOpenFile;
// ...
ofnOpenFile.lpstrFile	= szSelectedFile;
ofnOpenFile.nMaxFile	= (MAX_PATH * 100) + 1;
// ...
if(GetOpenFileName(&amp;ofnOpenFile))
{
	TCHAR szFilePath[MAX_PATH + 1];
	UINT  uiOffset = ofnOpenFile.nFileOffset;

	lstrcpy(szFilePath, szSelectedFile);
	lstrcat(szFilePath, TEXT(&quot;\\&quot;));

	while(szSelectedFile[uiOffset] != 0)
	{
		lstrcpy(&amp;szFilePath[ofnOpenFile.nFileOffset], &amp;szSelectedFile[uiOffset]);
		uiOffset += lstrlen(&amp;szSelectedFile[uiOffset]) + 1;
		// szFilePath dann im Folgenden verarbeiten
		// ...
	}
}

// ...
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1245603</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1245603</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Wed, 14 Mar 2007 16:19:57 GMT</pubDate></item><item><title><![CDATA[Reply to GetOpenFileName mit OFN_ALLOWMULTISELECT on Thu, 15 Mar 2007 07:06:39 GMT]]></title><description><![CDATA[<p>// wegedit wegen bloedheit</p>
<p>vielen dank, das war genau das was ich brauchte - haette ja mal genauer hinschaun sollen / koennen</p>
<p>danke {=</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1245717</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1245717</guid><dc:creator><![CDATA[EXDW]]></dc:creator><pubDate>Thu, 15 Mar 2007 07:06:39 GMT</pubDate></item><item><title><![CDATA[Reply to GetOpenFileName mit OFN_ALLOWMULTISELECT on Thu, 15 Mar 2007 07:39:54 GMT]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> , hatte gestern keine Zeit mehr auf dein letzten Post zu antworten (also als er noch nicht editiert war), aber hat sich ja dann wohl geklärt <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1245858</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1245858</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Thu, 15 Mar 2007 07:39:54 GMT</pubDate></item></channel></rss>