<?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[CFont wieder mal]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte eine Schriftart in einem CFrameWnd ändern. Habe mich so ein bischen durchs Forum durchgelesen, aber man muss immer diese LOGFONT-STruktur voll initialisieren. Gibt es denn nicht eine Möglichkeit nur z.B. die Schriftart und Schriftgroesse zu setzen ?</p>
<p>z.B. sowas was leider nicht funzt:</p>
<pre><code class="language-cpp">CFont* font;
 font = new CFont;
 font-&gt;CreatePointFont(200, (LPCTSTR)&quot;Arial&quot;);
 ...
</code></pre>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/162580/cfont-wieder-mal</link><generator>RSS for Node</generator><lastBuildDate>Thu, 30 Jul 2026 06:12:03 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/162580.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 20 Oct 2006 01:45:29 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to CFont wieder mal on Fri, 20 Oct 2006 01:45:29 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich möchte eine Schriftart in einem CFrameWnd ändern. Habe mich so ein bischen durchs Forum durchgelesen, aber man muss immer diese LOGFONT-STruktur voll initialisieren. Gibt es denn nicht eine Möglichkeit nur z.B. die Schriftart und Schriftgroesse zu setzen ?</p>
<p>z.B. sowas was leider nicht funzt:</p>
<pre><code class="language-cpp">CFont* font;
 font = new CFont;
 font-&gt;CreatePointFont(200, (LPCTSTR)&quot;Arial&quot;);
 ...
</code></pre>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158048</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158048</guid><dc:creator><![CDATA[Newbie01]]></dc:creator><pubDate>Fri, 20 Oct 2006 01:45:29 GMT</pubDate></item><item><title><![CDATA[Reply to CFont wieder mal on Fri, 20 Oct 2006 05:41:29 GMT]]></title><description><![CDATA[<p>Hi!</p>
<p>Ich hab hier nen Schnipsel, wo ich mir den Font eines Buttons hole und nur fett mache. Ich denke mal, dass kannst du anpassen. <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>
<pre><code class="language-cpp">// Schriftarten erzeugen
		CWnd* pWnd = GetDlgItem(IDC_RDO_KUNDENINFO); 
		LOGFONT lf; 
		CFont* font = pWnd-&gt;GetFont();
		if (font)
		{
			font-&gt;GetLogFont(&amp;lf);
			m_fontNormal.CreateFontIndirect(&amp;lf);
			lf.lfWeight = FW_BOLD;
			m_fontFett.CreateFontIndirect(&amp;lf);
		}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1158064</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158064</guid><dc:creator><![CDATA[estartu]]></dc:creator><pubDate>Fri, 20 Oct 2006 05:41:29 GMT</pubDate></item><item><title><![CDATA[Reply to CFont wieder mal on Fri, 20 Oct 2006 08:17:07 GMT]]></title><description><![CDATA[<p>Newbie01 schrieb:</p>
<blockquote>
<pre><code class="language-cpp">CFont* font;
 font = new CFont;
 font-&gt;CreatePointFont(200, (LPCTSTR)&quot;Arial&quot;);
 ...
</code></pre>
</blockquote>
<p>BTW: Warum dieser cast? Der ist in jedem Fall falsch, wenn es sich um ein UNICODE Projekt handelt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158125</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158125</guid><dc:creator><![CDATA[Martin Richter]]></dc:creator><pubDate>Fri, 20 Oct 2006 08:17:07 GMT</pubDate></item><item><title><![CDATA[Reply to CFont wieder mal on Sat, 21 Oct 2006 00:00:29 GMT]]></title><description><![CDATA[<p>Hallo danke erstmal für eure Hilfe.</p>
<p>Habe jetzt mal folgendes ausprobiert so wie das auch in der MSDN steht aber ich bekomme eine Compilerfehlermeldung weis jemand woran das liegt und was ich da ändern muss ?</p>
<pre><code class="language-cpp">CFont font;
LOGFONT lf;
memset(&amp;lf, 0, sizeof(LOGFONT));       // zero out structure
lf.lfHeight = 12;                      // request a 12-pixel-height font
strcpy(lf.lfFaceName, &quot;Arial&quot;);        // request a face name &quot;Arial&quot;
VERIFY(font.CreateFontIndirect(&amp;lf));  // create the font
</code></pre>
<p>error C2664: 'strcpy': Konvertierung des Parameters 1 von 'WCHAR [32]' in 'char *' nicht möglich</p>
<p>Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158501</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158501</guid><dc:creator><![CDATA[Newbie01]]></dc:creator><pubDate>Sat, 21 Oct 2006 00:00:29 GMT</pubDate></item><item><title><![CDATA[Reply to CFont wieder mal on Sat, 21 Oct 2006 00:31:25 GMT]]></title><description><![CDATA[<p>machmal</p>
<pre><code class="language-cpp">strcpy(lf.lfFaceName, _T(&quot;Arial&quot;));
</code></pre>
<p>Hängt mit dem VS2005 zusammen. Da sind alle Texte neu als ... ehm *kann die zwei Typen nie unterscheiden* ... jedenfalls als Wide Char interpretiert. Früher waren es normale char's. Somit muss man nun neu _T(&quot;&quot;) benutzen, wenn man eben char* will ^^</p>
<p>Richtig erklärt? ^^</p>
<p>Grüssli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158507</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158507</guid><dc:creator><![CDATA[Dravere]]></dc:creator><pubDate>Sat, 21 Oct 2006 00:31:25 GMT</pubDate></item><item><title><![CDATA[Reply to CFont wieder mal on Sat, 21 Oct 2006 23:09:30 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<blockquote>
<p>strcpy(lf.lfFaceName, _T(&quot;Arial&quot;));</p>
</blockquote>
<p>habe ich auch schon probiert aber haut trotzdem nicht hin da gibts folgende Fehlermeldung:</p>
<p>error C2664: 'strcpy': Konvertierung des Parameters 1 von 'WCHAR [32]' in 'char *' nicht möglich<br />
Die Typen, auf die verwiesen wird, sind nicht verknüpft; die Konvertierung erfordert einen reinterpret_cast-Operator oder eine Typumwandlung im C- oder Funktionsformat.</p>
<p>Muss ich hier etwa wirklich einen STL-reinterpreter_cast durchführen ?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1158828</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1158828</guid><dc:creator><![CDATA[Newbie01]]></dc:creator><pubDate>Sat, 21 Oct 2006 23:09:30 GMT</pubDate></item></channel></rss>