<?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[Problem mit GetCharWidth32]]></title><description><![CDATA[<p>habe hier eine Funktion einzelen Buchstaben von Text per DrawText zu zeichnen:</p>
<pre><code class="language-cpp">int __stdcall MyDrawText(HDC hDC, char *Text, int nCount, LPRECT rc, UINT uFormat){

	int		iWidth;
	char		dots[4];

 	while(*Text){
		if(rc-&gt;left &gt;= rc-&gt;right){
			return 1;
		}else if((rc-&gt;left + 11 &gt; rc-&gt;right) &amp;&amp; (uFormat &amp; DT_WORD_ELLIPSIS)){
			strcpy(dots, &quot;...&quot;);
			DrawText(hDC, dots, strlen(dots), rc, uFormat);
			GetCharWidth32(hDC, dots[0], dots[2], &amp;iWidth);
		}else{
			DrawText(hDC, Text, 1, rc, uFormat);
			GetCharWidth32(hDC, *Text, *Text, &amp;iWidth);
		}
		rc-&gt;left+= iWidth;
//		rc-&gt;left+= 10;	//damit gehts
		Text++;
	}
	return 1;
}
</code></pre>
<p>Bei Buchstaben die kleiner als (int)128 sind funktioniert es, wenn die Buchsatben gößer sind liefert GetCharWidth32 nicht die richtigen Werte um den Zeilenvorschub korrekt auszufüheren. Wie kann man das beheben?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/218100/problem-mit-getcharwidth32</link><generator>RSS for Node</generator><lastBuildDate>Wed, 15 Apr 2026 06:02:42 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/218100.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 16 Jul 2008 05:06:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit GetCharWidth32 on Wed, 16 Jul 2008 05:06:18 GMT]]></title><description><![CDATA[<p>habe hier eine Funktion einzelen Buchstaben von Text per DrawText zu zeichnen:</p>
<pre><code class="language-cpp">int __stdcall MyDrawText(HDC hDC, char *Text, int nCount, LPRECT rc, UINT uFormat){

	int		iWidth;
	char		dots[4];

 	while(*Text){
		if(rc-&gt;left &gt;= rc-&gt;right){
			return 1;
		}else if((rc-&gt;left + 11 &gt; rc-&gt;right) &amp;&amp; (uFormat &amp; DT_WORD_ELLIPSIS)){
			strcpy(dots, &quot;...&quot;);
			DrawText(hDC, dots, strlen(dots), rc, uFormat);
			GetCharWidth32(hDC, dots[0], dots[2], &amp;iWidth);
		}else{
			DrawText(hDC, Text, 1, rc, uFormat);
			GetCharWidth32(hDC, *Text, *Text, &amp;iWidth);
		}
		rc-&gt;left+= iWidth;
//		rc-&gt;left+= 10;	//damit gehts
		Text++;
	}
	return 1;
}
</code></pre>
<p>Bei Buchstaben die kleiner als (int)128 sind funktioniert es, wenn die Buchsatben gößer sind liefert GetCharWidth32 nicht die richtigen Werte um den Zeilenvorschub korrekt auszufüheren. Wie kann man das beheben?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1547960</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1547960</guid><dc:creator><![CDATA[m&amp;amp;&amp;amp;m]]></dc:creator><pubDate>Wed, 16 Jul 2008 05:06:18 GMT</pubDate></item></channel></rss>