<?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[LPCWSTR nach char* umwandeln, der von ExtTextOut übergeben wurde]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich ändere mittels detours die Funktion ExtTextOut und möchte den übergebenen String abfangen.<br />
Jedoch klappt das umwandeln des Strings nicht, es kommen immer irgendwelche &quot;Hyroglyphen&quot; heraus.<br />
Mein Code dazu sieht so aus:</p>
<pre><code class="language-cpp">int WINAPI Mine_ExtTextOut(HDC hdc, int x, int y, UINT options, const RECT * lprect , LPCWSTR lpwstr, UINT c, const int * lpDx )
{
    int rv =Real_ExtTextOut(hdc, x, y, options, lprect, lpwstr, c, lpDx);

	if(lpwstr==0)
		return TRUE;

	char* ascii = new char[wcslen(lpwstr) + 1];

	wcstombs( ascii, lpwstr, wcslen(lpwstr) );
	ofstream logFile(&quot;c:\\log.file&quot;, ios::out | ios::app);
	logFile &lt;&lt; wcslen(lpwstr) + 1 &lt;&lt; &quot;: &quot; &lt;&lt; ascii &lt;&lt; endl;
	delete [] ascii;

    return rv;
}
</code></pre>
<p>Wenn ich einfach einen String selber aus nem Literal erstelle, klappt es.<br />
Woran liegt es, dass die Umwandlung des Parameters der ExtTextOut Funktion nicht klappt?</p>
<p>Bin für jede Hilfe dankbar,</p>
<p>eimaa</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/231323/lpcwstr-nach-char-umwandeln-der-von-exttextout-übergeben-wurde</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Apr 2026 20:24:25 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/231323.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 08 Jan 2009 20:59:24 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to LPCWSTR nach char* umwandeln, der von ExtTextOut übergeben wurde on Thu, 08 Jan 2009 20:59:24 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich ändere mittels detours die Funktion ExtTextOut und möchte den übergebenen String abfangen.<br />
Jedoch klappt das umwandeln des Strings nicht, es kommen immer irgendwelche &quot;Hyroglyphen&quot; heraus.<br />
Mein Code dazu sieht so aus:</p>
<pre><code class="language-cpp">int WINAPI Mine_ExtTextOut(HDC hdc, int x, int y, UINT options, const RECT * lprect , LPCWSTR lpwstr, UINT c, const int * lpDx )
{
    int rv =Real_ExtTextOut(hdc, x, y, options, lprect, lpwstr, c, lpDx);

	if(lpwstr==0)
		return TRUE;

	char* ascii = new char[wcslen(lpwstr) + 1];

	wcstombs( ascii, lpwstr, wcslen(lpwstr) );
	ofstream logFile(&quot;c:\\log.file&quot;, ios::out | ios::app);
	logFile &lt;&lt; wcslen(lpwstr) + 1 &lt;&lt; &quot;: &quot; &lt;&lt; ascii &lt;&lt; endl;
	delete [] ascii;

    return rv;
}
</code></pre>
<p>Wenn ich einfach einen String selber aus nem Literal erstelle, klappt es.<br />
Woran liegt es, dass die Umwandlung des Parameters der ExtTextOut Funktion nicht klappt?</p>
<p>Bin für jede Hilfe dankbar,</p>
<p>eimaa</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1642072</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1642072</guid><dc:creator><![CDATA[eimaa]]></dc:creator><pubDate>Thu, 08 Jan 2009 20:59:24 GMT</pubDate></item><item><title><![CDATA[Reply to LPCWSTR nach char* umwandeln, der von ExtTextOut übergeben wurde on Thu, 08 Jan 2009 22:00:28 GMT]]></title><description><![CDATA[<p>wcslen(lpwstr) + 1 in wcstombs sonst kommt die 0 nich mit rein</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1642109</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1642109</guid><dc:creator><![CDATA[nupperle]]></dc:creator><pubDate>Thu, 08 Jan 2009 22:00:28 GMT</pubDate></item><item><title><![CDATA[Reply to LPCWSTR nach char* umwandeln, der von ExtTextOut übergeben wurde on Thu, 08 Jan 2009 22:34:54 GMT]]></title><description><![CDATA[<p>Danke, löst das problem aber leider noch nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1642131</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1642131</guid><dc:creator><![CDATA[eimaa]]></dc:creator><pubDate>Thu, 08 Jan 2009 22:34:54 GMT</pubDate></item><item><title><![CDATA[Reply to LPCWSTR nach char* umwandeln, der von ExtTextOut übergeben wurde on Thu, 08 Jan 2009 22:37:34 GMT]]></title><description><![CDATA[<p>klaro bei mir funzto es doch!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1642134</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1642134</guid><dc:creator><![CDATA[nupperle]]></dc:creator><pubDate>Thu, 08 Jan 2009 22:37:34 GMT</pubDate></item><item><title><![CDATA[Reply to LPCWSTR nach char* umwandeln, der von ExtTextOut übergeben wurde on Thu, 08 Jan 2009 23:01:31 GMT]]></title><description><![CDATA[<p>nupperle schrieb:</p>
<blockquote>
<p>klaro bei mir funzto es doch!</p>
</blockquote>
<p>Hast du auch die Funktion ExtTextOut detoured oder nur einen LPCWSTR erstellt und umgewandelt?<br />
Wenn ich den string selber erstelle, klappt es bei mir auch.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1642144</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1642144</guid><dc:creator><![CDATA[eimaa]]></dc:creator><pubDate>Thu, 08 Jan 2009 23:01:31 GMT</pubDate></item><item><title><![CDATA[Reply to LPCWSTR nach char* umwandeln, der von ExtTextOut übergeben wurde on Fri, 09 Jan 2009 07:20:23 GMT]]></title><description><![CDATA[<p>Aus was hast Du Detours angewendet? Auf ExtTextOutA oder ExtTextOutW?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1642223</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1642223</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 09 Jan 2009 07:20:23 GMT</pubDate></item><item><title><![CDATA[Reply to LPCWSTR nach char* umwandeln, der von ExtTextOut übergeben wurde on Fri, 09 Jan 2009 10:25:47 GMT]]></title><description><![CDATA[<p>Auf die ExtTextOutW.</p>
<p>Die ExtTextOutA wird nicht aufgerufen, zumindest bleibt das Logfile dann leer.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1642304</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1642304</guid><dc:creator><![CDATA[eimaa]]></dc:creator><pubDate>Fri, 09 Jan 2009 10:25:47 GMT</pubDate></item></channel></rss>