<?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[Neues Änfängerproblem]]></title><description><![CDATA[<p>Hallo,</p>
<p>arbeite mich anhand verschiedener Tutorials durch die WinAPI. Leider stehe ich nun vor dem Problem das ich einen Variablen Text im WindowsFenster ausgeben möchte.</p>
<p>ich habe mir da folgendes ausgedacht:</p>
<pre><code class="language-cpp">case WM_PAINT:
		{
			HDC				hDC;				/* Handle zum Device Contex		*/
			PAINTSTRUCT		ps;					/* Speichert Zeichen Daten		*/

			const char		szText =	(char)iInitUSB;	/* Unsere auszugebenen Strings	*/

			const int		iAnzahlZeilen	= 4;	/* Ist von szText abhängig	*/
			const int		iZeilenabstand	= 18;	/* Passt einigermaßen		*/

			hDC = BeginPaint(hWnd, &amp;ps);			/* Zeichenvorgang anmelden	*/
			{
					TextOut(hDC, 50, 50, szText, sizeof(szText) - 1);
			}
			EndPaint(hWnd, &amp;ps);					/* Zeichenvorgang beendet	*/

			return 0;
		}
</code></pre>
<p>wie man an iInitUSB unschwer erkennen kann, will ich aus einem Int einen CHAR machen, und dann in TEXTOUT verwenden. Leider bekomme ich immer die Meldung:</p>
<p><strong>.\First_USB_API.cpp(132) : error C2664: 'TextOutA' : cannot convert parameter 4 from 'const char' to 'LPCSTR'</strong></p>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> verstehe ich leider nicht warum.</p>
<p>Gruß Peer</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/137719/neues-änfängerproblem</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 18:31:23 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/137719.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 20 Feb 2006 10:36:30 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Neues Änfängerproblem on Mon, 20 Feb 2006 10:36:30 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>arbeite mich anhand verschiedener Tutorials durch die WinAPI. Leider stehe ich nun vor dem Problem das ich einen Variablen Text im WindowsFenster ausgeben möchte.</p>
<p>ich habe mir da folgendes ausgedacht:</p>
<pre><code class="language-cpp">case WM_PAINT:
		{
			HDC				hDC;				/* Handle zum Device Contex		*/
			PAINTSTRUCT		ps;					/* Speichert Zeichen Daten		*/

			const char		szText =	(char)iInitUSB;	/* Unsere auszugebenen Strings	*/

			const int		iAnzahlZeilen	= 4;	/* Ist von szText abhängig	*/
			const int		iZeilenabstand	= 18;	/* Passt einigermaßen		*/

			hDC = BeginPaint(hWnd, &amp;ps);			/* Zeichenvorgang anmelden	*/
			{
					TextOut(hDC, 50, 50, szText, sizeof(szText) - 1);
			}
			EndPaint(hWnd, &amp;ps);					/* Zeichenvorgang beendet	*/

			return 0;
		}
</code></pre>
<p>wie man an iInitUSB unschwer erkennen kann, will ich aus einem Int einen CHAR machen, und dann in TEXTOUT verwenden. Leider bekomme ich immer die Meldung:</p>
<p><strong>.\First_USB_API.cpp(132) : error C2664: 'TextOutA' : cannot convert parameter 4 from 'const char' to 'LPCSTR'</strong></p>
<p><img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /> verstehe ich leider nicht warum.</p>
<p>Gruß Peer</p>
]]></description><link>https://www.c-plusplus.net/forum/post/998397</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/998397</guid><dc:creator><![CDATA[Nightstorm]]></dc:creator><pubDate>Mon, 20 Feb 2006 10:36:30 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Änfängerproblem on Mon, 20 Feb 2006 10:46:23 GMT]]></title><description><![CDATA[<p>Wenn du Text ausgeben willst, benötigst du keinen char (der fasst nur ein einzelnes Zeichen), sondern einen char* oder char[] (Zeichenkette - inklusive Null-Terminator).</p>
<p>Und wie du eine Zahl in Textform umwandeln kannst, liest du dir am besten in der C++-FAQ durch (Stichwort: Text nach Zahl und zurück) - deine Methode ist jedenfalls nicht richtig <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/998402</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/998402</guid><dc:creator><![CDATA[CStoll (off)]]></dc:creator><pubDate>Mon, 20 Feb 2006 10:46:23 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Änfängerproblem on Mon, 20 Feb 2006 10:57:26 GMT]]></title><description><![CDATA[<p>Das dises Variante nicht funktioniert, weiß ich auch.</p>
<p>ich wollte eigendlich hauptsächlich wissen wie ich das in der WinAPI hin bekomme.</p>
<p>und da hilft mir deine Aussage leider so garnicht weiter.</p>
<p><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/998411</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/998411</guid><dc:creator><![CDATA[Nightstorm]]></dc:creator><pubDate>Mon, 20 Feb 2006 10:57:26 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Änfängerproblem on Mon, 20 Feb 2006 11:10:26 GMT]]></title><description><![CDATA[<p>änder auch &quot;sizeof(szText) - 1&quot; zu &quot;sizeof(szText)&quot;</p>
<p>MfG RadiatioN</p>
]]></description><link>https://www.c-plusplus.net/forum/post/998430</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/998430</guid><dc:creator><![CDATA[Radiation2K5]]></dc:creator><pubDate>Mon, 20 Feb 2006 11:10:26 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Änfängerproblem on Mon, 20 Feb 2006 11:18:07 GMT]]></title><description><![CDATA[<p>wie gesagt...</p>
<p>TextOut erwartet einen const char* und keinen char*</p>
<p>-&gt;</p>
<p>char text[256];<br />
strcpy(text, &quot;fdahöfjdkafjd&quot;);<br />
TextOut(..., text, ...);</p>
]]></description><link>https://www.c-plusplus.net/forum/post/998437</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/998437</guid><dc:creator><![CDATA[Maxi]]></dc:creator><pubDate>Mon, 20 Feb 2006 11:18:07 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Änfängerproblem on Mon, 20 Feb 2006 11:27:19 GMT]]></title><description><![CDATA[<p>Danke, ich habe mich jetzt folgender Methode bedient:</p>
<pre><code class="language-cpp">char szText [2];
			_itoa_s(iInitUSB,szText,2);	/* Unsere auszugebenen Strings	*/

			hDC = BeginPaint(hWnd, &amp;ps);			/* Zeichenvorgang anmelden	*/
			{
					TextOut(hDC, 50, 50, szText, sizeof(szText)-1);
			}
			EndPaint(hWnd, &amp;ps);					/* Zeichenvorgang beendet	*/
</code></pre>
<p>scheint zu funktionieren.</p>
<p>Gruß Peer</p>
]]></description><link>https://www.c-plusplus.net/forum/post/998440</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/998440</guid><dc:creator><![CDATA[Nightstorm]]></dc:creator><pubDate>Mon, 20 Feb 2006 11:27:19 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Änfängerproblem on Mon, 20 Feb 2006 11:50:19 GMT]]></title><description><![CDATA[<p>Nightstorm schrieb:</p>
<blockquote>
<p>ich wollte eigendlich hauptsächlich wissen wie ich das in der WinAPI hin bekomme.</p>
</blockquote>
<p>Soll ich dich noch an der Hand ins FAQ-Board führen?</p>
<p>(btw, bist du sicher, daß 1 Ziffer für deine Ausgabe ausreicht?)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/998457</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/998457</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Mon, 20 Feb 2006 11:50:19 GMT</pubDate></item><item><title><![CDATA[Reply to Neues Änfängerproblem on Mon, 20 Feb 2006 12:25:43 GMT]]></title><description><![CDATA[<p>jep da bin ich mir sicher..</p>
]]></description><link>https://www.c-plusplus.net/forum/post/998503</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/998503</guid><dc:creator><![CDATA[Nightstorm]]></dc:creator><pubDate>Mon, 20 Feb 2006 12:25:43 GMT</pubDate></item></channel></rss>