<?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[Öffnen von Dateien]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/26a0.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--warning"
      title=":warning:"
      alt="⚠"
    /><br />
Hallo,<br />
ich habe da eín Problem. Wie kann ich mit Hilfe eines Buutons ein x-beliebge Datei öffnen (Quelltext).</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/52467/öffnen-von-dateien</link><generator>RSS for Node</generator><lastBuildDate>Mon, 01 Jun 2026 00:19:46 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/52467.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 20 Oct 2003 13:22:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Öffnen von Dateien on Mon, 20 Oct 2003 13:22:19 GMT]]></title><description><![CDATA[<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/26a0.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--warning"
      title=":warning:"
      alt="⚠"
    /><br />
Hallo,<br />
ich habe da eín Problem. Wie kann ich mit Hilfe eines Buutons ein x-beliebge Datei öffnen (Quelltext).</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/375797</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/375797</guid><dc:creator><![CDATA[webid]]></dc:creator><pubDate>Mon, 20 Oct 2003 13:22:19 GMT</pubDate></item><item><title><![CDATA[Reply to Öffnen von Dateien on Mon, 20 Oct 2003 13:38:43 GMT]]></title><description><![CDATA[<p>Das geht auf wundersame Weise. Man erstellt einen Button und setzt bei den Properties : &quot;öffne mir eine x-beliebige Datei&quot; und dann noch die Option: &quot;mit Source-Code&quot; und alles ist erledigt... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f621.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--pouting_face"
      title=":rage:"
      alt="😡"
    /><br />
Schau mal in die Hilfe. Wurde schon zig-mal behandelt. Und außerdem was heißt bei dir x-belibig? Willts du während der Programmausführung eine Datei auswählen oder eine fest vorgeben per Code?<br />
Schau dir mal die Klassen: CFile, CStdioFile, CFileDialog an. Dann hast du alles was du brauchst mit Source-Code.</p>
<p>Gruß,</p>
<p>Stalin <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/375817</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/375817</guid><dc:creator><![CDATA[Stalin]]></dc:creator><pubDate>Mon, 20 Oct 2003 13:38:43 GMT</pubDate></item><item><title><![CDATA[Reply to Öffnen von Dateien on Mon, 20 Oct 2003 13:40:05 GMT]]></title><description><![CDATA[<p>Servus,</p>
<p>gibs mehrer Möglichkeiten z.B. mit CFile oder CStdioFile.</p>
<p>z.B.</p>
<pre><code class="language-cpp">void CDeinDialog::OnBnClickedButtonOpen()
{
	CFileDialog fileDialog(TRUE, _T(&quot;*.*&quot;), NULL,  OFN_FILEMUSTEXIST| OFN_HIDEREADONLY, _T(&quot;All files (*.*)|*.*&quot;), this);
	if (fileDialog.DoModal() == IDOK)
	{
          //wenn OK gedrückt dann mach was
         }

}
</code></pre>
<p>Die Filterung bei CFileDialog ist auf alle Dateien eingestellt wie man das einrichtet für verschiedene Typen steht in der MSDN.</p>
<p>Wenn geöffnet kannst du denn Dateiinhalt lesen z.B.</p>
<pre><code class="language-cpp">void CDeinDialog::OnBnClickedButtonOpen()
{
	CFileDialog fileDialog(TRUE, _T(&quot;*.*&quot;), NULL,  OFN_FILEMUSTEXIST| OFN_HIDEREADONLY, _T(&quot;All files (*.*)|*.*&quot;), this);
	if (fileDialog.DoModal() == IDOK)
	{
		CStdioFile stfListFile;
		CFileException eFile;
		CString strTmp;

		stfListFile.Open(_T(&quot;fileDialog.GetPathName()&quot;), CFile::modeRead, &amp;eFile);
		do
		{
			stfListFile.ReadString(strTmp);
		}
		while (strTmp != &quot;&quot;);
		stfListFile.Close();
	}
}
</code></pre>
<p>Alles weiter ist schön in der MSDN, FAQ und in 1000 Beispielen in dem Forum hier erklärt.</p>
<p>Gruss<br />
Hellsgore</p>
]]></description><link>https://www.c-plusplus.net/forum/post/375820</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/375820</guid><dc:creator><![CDATA[Hellsgore]]></dc:creator><pubDate>Mon, 20 Oct 2003 13:40:05 GMT</pubDate></item><item><title><![CDATA[Reply to Öffnen von Dateien on Tue, 21 Oct 2003 09:16:23 GMT]]></title><description><![CDATA[<p>Hab da noch ne weitere Frage. Mir ist jetzt klar wie man das Öffnen von allen Dateien hinbekommt. Doch wie muß ich machen, damit ich alle Dateien und nur pdf oder Excel-Dateien anzeigen kann?</p>
<p>webid</p>
]]></description><link>https://www.c-plusplus.net/forum/post/376305</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/376305</guid><dc:creator><![CDATA[webid]]></dc:creator><pubDate>Tue, 21 Oct 2003 09:16:23 GMT</pubDate></item><item><title><![CDATA[Reply to Öffnen von Dateien on Tue, 21 Oct 2003 09:37:17 GMT]]></title><description><![CDATA[<p>Habe das schon so rausgefunden.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/376336</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/376336</guid><dc:creator><![CDATA[webid]]></dc:creator><pubDate>Tue, 21 Oct 2003 09:37:17 GMT</pubDate></item></channel></rss>