<?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[File Pfad ohne filename?]]></title><description><![CDATA[<p>servus. Diesen Code hier habe ich gefunden um mir den Filepfad geben zu lassen:</p>
<pre><code class="language-cpp">TCHAR szFileName[MAX_PATH];
	GetModuleFileName(NULL, szFileName, MAX_PATH);
	MessageBox(NULL, szFileName, TEXT(&quot;Info&quot;), 0);
</code></pre>
<p>aber da ist auch noch der name und .exe dran. Das will ich aber nicht.<br />
GetCurrentDirectory sollte man ja für sowas auch nicht verwenden, weil das nicht immer der exepfad sein muss. Wie komme ich also an den Pfad ohne erweiterung?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/241208/file-pfad-ohne-filename</link><generator>RSS for Node</generator><lastBuildDate>Mon, 06 Apr 2026 04:07:26 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/241208.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 17 May 2009 16:36:37 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to File Pfad ohne filename? on Sun, 17 May 2009 16:36:37 GMT]]></title><description><![CDATA[<p>servus. Diesen Code hier habe ich gefunden um mir den Filepfad geben zu lassen:</p>
<pre><code class="language-cpp">TCHAR szFileName[MAX_PATH];
	GetModuleFileName(NULL, szFileName, MAX_PATH);
	MessageBox(NULL, szFileName, TEXT(&quot;Info&quot;), 0);
</code></pre>
<p>aber da ist auch noch der name und .exe dran. Das will ich aber nicht.<br />
GetCurrentDirectory sollte man ja für sowas auch nicht verwenden, weil das nicht immer der exepfad sein muss. Wie komme ich also an den Pfad ohne erweiterung?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1711855</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1711855</guid><dc:creator><![CDATA[FileNameWithoutExtension]]></dc:creator><pubDate>Sun, 17 May 2009 16:36:37 GMT</pubDate></item><item><title><![CDATA[Reply to File Pfad ohne filename? on Sun, 17 May 2009 16:45:14 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">TCHAR szFileName[MAX_PATH]; 
GetModuleFileName(NULL, szFileName, MAX_PATH); 
*PathFindFileName(szFileName) = 0;
MessageBox(NULL, szFileName, TEXT(&quot;Info&quot;), 0);
</code></pre>
<p><a href="http://msdn.microsoft.com/en-us/library/bb773589(VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb773589(VS.85).aspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1711859</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1711859</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sun, 17 May 2009 16:45:14 GMT</pubDate></item><item><title><![CDATA[Reply to File Pfad ohne filename? on Sun, 17 May 2009 17:03:03 GMT]]></title><description><![CDATA[<p>juhu Martin Richter vielen Dank du bist der beste <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1711869</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1711869</guid><dc:creator><![CDATA[FileNameWithoutExtension]]></dc:creator><pubDate>Sun, 17 May 2009 17:03:03 GMT</pubDate></item><item><title><![CDATA[Reply to File Pfad ohne filename? on Sun, 17 May 2009 17:13:22 GMT]]></title><description><![CDATA[<p>Ich würd's eher so machen:</p>
<pre><code class="language-cpp">TCHAR szFileName[MAX_PATH];
GetModuleFileName(NULL, szFileName, MAX_PATH);
PathRemoveFileSpec(szFileName);
MessageBox(NULL, szFileName, TEXT(&quot;Info&quot;), 0);
</code></pre>
<p><a href="http://msdn.microsoft.com/en-us/library/bb773748(VS.85).aspx" rel="nofollow">http://msdn.microsoft.com/en-us/library/bb773748(VS.85).aspx</a></p>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1711876</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1711876</guid><dc:creator><![CDATA[Gästchen]]></dc:creator><pubDate>Sun, 17 May 2009 17:13:22 GMT</pubDate></item><item><title><![CDATA[Reply to File Pfad ohne filename? on Sun, 17 May 2009 17:32:26 GMT]]></title><description><![CDATA[<p>@gaestchen: Jo ist schöner!</p>
<p>Aber Achtung. Bei mir bleibt der Backslash und bei Dir nicht!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1711879</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1711879</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Sun, 17 May 2009 17:32:26 GMT</pubDate></item><item><title><![CDATA[Reply to File Pfad ohne filename? on Sun, 17 May 2009 17:44:48 GMT]]></title><description><![CDATA[<p>Wenn ich noch was anfügen möchte, nutze ich PathAppend. Da kann es mir ganz egal sein, ob der Backslash nun da ist oder nicht. <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/1711885</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1711885</guid><dc:creator><![CDATA[Gaestchen]]></dc:creator><pubDate>Sun, 17 May 2009 17:44:48 GMT</pubDate></item></channel></rss>