<?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[PathFindExtension: Problem]]></title><description><![CDATA[<p>Hallo Leute.</p>
<p>Ich habe ein Problem mit einem Pfad, dessen extension ich mir per PathFindExtension hole, per PathRemoveExtension lösche, um den Dateinamen zu erweitern und anschließend mit PathAddExtension wieder zufüge.</p>
<p>Irgendwie gibt PathAddExtension kein Resultat zurück, obwohl die Datei eine Erweiterung hat.</p>
<pre><code class="language-cpp">/*
 * Renames a file until it does not exist
 */
void AutoRename(LPWSTR lpFileName)
{
	// get the extension
	// hier ist was faul, denn die Funktion fügt keine Extension an,
	// also muss hier der fehler liegen
	LPWSTR lpExtension = PathFindExtension(lpFileName);
	int nCount = 1;

	WCHAR newPath[MAX_PATH + 1];
	lstrcpy(newPath, lpFileName);

	while ((PathFileExists(newPath)) &amp;&amp; (nCount &lt; 256))
	{
		lstrcpy(newPath, lpFileName);
		PathRemoveExtension(newPath);

		// nun, wie bekomme ich nCount zu LPWSTR???

		PathAddExtension(newPath, lpExtension);
	}

	lstrcpy(lpFileName, newPath);
}
</code></pre>
<p>Desweiteren weiß ich nicht, wie ich einen Int-Wert in einen LPCWstr bekomme, aber das soll jetzt nicht stören, wäre aber nett.</p>
<p>Danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/203554/pathfindextension-problem</link><generator>RSS for Node</generator><lastBuildDate>Mon, 27 Apr 2026 05:05:13 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/203554.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 23 Jan 2008 19:46:36 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to PathFindExtension: Problem on Wed, 23 Jan 2008 19:46:36 GMT]]></title><description><![CDATA[<p>Hallo Leute.</p>
<p>Ich habe ein Problem mit einem Pfad, dessen extension ich mir per PathFindExtension hole, per PathRemoveExtension lösche, um den Dateinamen zu erweitern und anschließend mit PathAddExtension wieder zufüge.</p>
<p>Irgendwie gibt PathAddExtension kein Resultat zurück, obwohl die Datei eine Erweiterung hat.</p>
<pre><code class="language-cpp">/*
 * Renames a file until it does not exist
 */
void AutoRename(LPWSTR lpFileName)
{
	// get the extension
	// hier ist was faul, denn die Funktion fügt keine Extension an,
	// also muss hier der fehler liegen
	LPWSTR lpExtension = PathFindExtension(lpFileName);
	int nCount = 1;

	WCHAR newPath[MAX_PATH + 1];
	lstrcpy(newPath, lpFileName);

	while ((PathFileExists(newPath)) &amp;&amp; (nCount &lt; 256))
	{
		lstrcpy(newPath, lpFileName);
		PathRemoveExtension(newPath);

		// nun, wie bekomme ich nCount zu LPWSTR???

		PathAddExtension(newPath, lpExtension);
	}

	lstrcpy(lpFileName, newPath);
}
</code></pre>
<p>Desweiteren weiß ich nicht, wie ich einen Int-Wert in einen LPCWstr bekomme, aber das soll jetzt nicht stören, wäre aber nett.</p>
<p>Danke.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1442307</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1442307</guid><dc:creator><![CDATA[Code:)]]></dc:creator><pubDate>Wed, 23 Jan 2008 19:46:36 GMT</pubDate></item><item><title><![CDATA[Reply to PathFindExtension: Problem on Wed, 23 Jan 2008 20:56:59 GMT]]></title><description><![CDATA[<p>Was ist der Sinn von</p>
<pre><code class="language-cpp">(nCount &lt; 256)
</code></pre>
<p>?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1442368</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1442368</guid><dc:creator><![CDATA[sri]]></dc:creator><pubDate>Wed, 23 Jan 2008 20:56:59 GMT</pubDate></item><item><title><![CDATA[Reply to PathFindExtension: Problem on Wed, 23 Jan 2008 21:00:15 GMT]]></title><description><![CDATA[<p>Hi Code:)</p>
<p>da Du im Moment intensiv Anfragen rund um Pfad- und Dateinamen stellst: Vielleicht hilft Dir der folgende Artikel?</p>
<p>Path Manipulation Routines<br />
<a href="http://www.geocities.com/SiliconValley/4942/paths.html" rel="nofollow">http://www.geocities.com/SiliconValley/4942/paths.html</a></p>
<p>Martin</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1442373</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1442373</guid><dc:creator><![CDATA[Mmacher]]></dc:creator><pubDate>Wed, 23 Jan 2008 21:00:15 GMT</pubDate></item><item><title><![CDATA[Reply to PathFindExtension: Problem on Thu, 24 Jan 2008 07:08:22 GMT]]></title><description><![CDATA[<p>Suchst Du PathRenameExtension?<br />
<a href="http://msdn2.microsoft.com/en-us/library/bb773749.aspx" rel="nofollow">http://msdn2.microsoft.com/en-us/library/bb773749.aspx</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1442496</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1442496</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Thu, 24 Jan 2008 07:08:22 GMT</pubDate></item></channel></rss>