<?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[Bin neu in WinAPI und habe probleme mit TextOut()]]></title><description><![CDATA[<p>Ich bin neu in WinAPI Programmierung. Ich möchte versuchen, etwas zu zeichnen, aber es funktioniert nicht.<br />
Dies ist mein Code:</p>
<pre><code class="language-cpp">#define STRICT
#include &lt;windows.h&gt;
#include &lt;string.h&gt;

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
  HWND WindowMain;
  MSG msg;
  WNDCLASS wc;
  wc.style = CS_HREDRAW|CS_VREDRAW;
  wc.lpfnWndProc = WndProc;
  wc.cbClsExtra = 0;
  wc.cbWndExtra = 0;
  wc.hInstance = hInstance;
  wc.hCursor = LoadCursor(NULL, IDC_ARROW);
  wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
  wc.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
  wc.lpszClassName = &quot;Meine Anwendung&quot;;
  wc.lpszMenuName = NULL;
  RegisterClass(&amp;wc);

  WindowMain = CreateWindow(&quot;Meine Anwendung&quot;,
                            &quot;Anwendung&quot;,
                            WS_OVERLAPPEDWINDOW,
                            128,
                            128,
                            640,
                            480,
                            NULL,
                            NULL,
                            hInstance,
                            NULL);
  ShowWindow(WindowMain, iCmdShow);
  UpdateWindow(WindowMain);
  while(GetMessage(&amp;msg, NULL, 0, 0))
  {
    TranslateMessage(&amp;msg);
    DispatchMessage(&amp;msg);
  }
  return msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
  static RECT rect;
  switch(message)
  {
    case WM_DESTROY:
    {
      PostQuitMessage(0);
      return 0;
    }
    case WM_KEYDOWN:
    {
      switch(wParam)
      {
        case VK_ESCAPE:
          PostQuitMessage(0);
          return 0;
      }
    }
    case WM_PAINT:
    {
      PAINTSTRUCT ps;
      HDC hDC;
      hDC = BeginPaint(hWnd, &amp;ps);
      TextOut(hDC, 50, 50, &quot;Hallo, Welt!&quot;, sizeof(&quot;Hallo, Welt!&quot;)-1);
      // lasse ich einfach diese Funktion weg, funktioniert es wieder
      EndPaint(hWnd, &amp;ps);
      return 0;
    }
  }
  return DefWindowProc(hWnd, message, wParam, lParam);
}
</code></pre>
<p>Wenn ich diesen Code mit Dev-C++ kompiliere, erscheint nicht, und unten (Fehler?) steht folgendes:</p>
<p><code>[Linker error] undefined reference to</code>TextOutA@20'</p>
<p>Id returned 1 exit status`</p>
<p>Kann mir da jemand weiterhelfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/229433/bin-neu-in-winapi-und-habe-probleme-mit-textout</link><generator>RSS for Node</generator><lastBuildDate>Fri, 10 Apr 2026 05:37:17 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/229433.rss" rel="self" type="application/rss+xml"/><pubDate>Thu, 11 Dec 2008 17:30:19 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Bin neu in WinAPI und habe probleme mit TextOut() on Thu, 11 Dec 2008 17:30:19 GMT]]></title><description><![CDATA[<p>Ich bin neu in WinAPI Programmierung. Ich möchte versuchen, etwas zu zeichnen, aber es funktioniert nicht.<br />
Dies ist mein Code:</p>
<pre><code class="language-cpp">#define STRICT
#include &lt;windows.h&gt;
#include &lt;string.h&gt;

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow)
{
  HWND WindowMain;
  MSG msg;
  WNDCLASS wc;
  wc.style = CS_HREDRAW|CS_VREDRAW;
  wc.lpfnWndProc = WndProc;
  wc.cbClsExtra = 0;
  wc.cbWndExtra = 0;
  wc.hInstance = hInstance;
  wc.hCursor = LoadCursor(NULL, IDC_ARROW);
  wc.hIcon = LoadIcon(NULL, IDI_APPLICATION);
  wc.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
  wc.lpszClassName = &quot;Meine Anwendung&quot;;
  wc.lpszMenuName = NULL;
  RegisterClass(&amp;wc);

  WindowMain = CreateWindow(&quot;Meine Anwendung&quot;,
                            &quot;Anwendung&quot;,
                            WS_OVERLAPPEDWINDOW,
                            128,
                            128,
                            640,
                            480,
                            NULL,
                            NULL,
                            hInstance,
                            NULL);
  ShowWindow(WindowMain, iCmdShow);
  UpdateWindow(WindowMain);
  while(GetMessage(&amp;msg, NULL, 0, 0))
  {
    TranslateMessage(&amp;msg);
    DispatchMessage(&amp;msg);
  }
  return msg.wParam;
}

LRESULT CALLBACK WndProc(HWND hWnd, UINT message, WPARAM wParam, LPARAM lParam)
{
  static RECT rect;
  switch(message)
  {
    case WM_DESTROY:
    {
      PostQuitMessage(0);
      return 0;
    }
    case WM_KEYDOWN:
    {
      switch(wParam)
      {
        case VK_ESCAPE:
          PostQuitMessage(0);
          return 0;
      }
    }
    case WM_PAINT:
    {
      PAINTSTRUCT ps;
      HDC hDC;
      hDC = BeginPaint(hWnd, &amp;ps);
      TextOut(hDC, 50, 50, &quot;Hallo, Welt!&quot;, sizeof(&quot;Hallo, Welt!&quot;)-1);
      // lasse ich einfach diese Funktion weg, funktioniert es wieder
      EndPaint(hWnd, &amp;ps);
      return 0;
    }
  }
  return DefWindowProc(hWnd, message, wParam, lParam);
}
</code></pre>
<p>Wenn ich diesen Code mit Dev-C++ kompiliere, erscheint nicht, und unten (Fehler?) steht folgendes:</p>
<p><code>[Linker error] undefined reference to</code>TextOutA@20'</p>
<p>Id returned 1 exit status`</p>
<p>Kann mir da jemand weiterhelfen?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1628993</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1628993</guid><dc:creator><![CDATA[asmodeus]]></dc:creator><pubDate>Thu, 11 Dec 2008 17:30:19 GMT</pubDate></item><item><title><![CDATA[Reply to Bin neu in WinAPI und habe probleme mit TextOut() on Thu, 11 Dec 2008 18:04:45 GMT]]></title><description><![CDATA[<p>Library: Use Gdi32.lib.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1629013</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629013</guid><dc:creator><![CDATA[hfghfg]]></dc:creator><pubDate>Thu, 11 Dec 2008 18:04:45 GMT</pubDate></item><item><title><![CDATA[Reply to Bin neu in WinAPI und habe probleme mit TextOut() on Thu, 11 Dec 2008 18:47:16 GMT]]></title><description><![CDATA[<p>hfghfg schrieb:</p>
<blockquote>
<p>Library: Use Gdi32.lib.</p>
</blockquote>
<p>How do I do that?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1629043</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629043</guid><dc:creator><![CDATA[asmodeus]]></dc:creator><pubDate>Thu, 11 Dec 2008 18:47:16 GMT</pubDate></item><item><title><![CDATA[Reply to Bin neu in WinAPI und habe probleme mit TextOut() on Thu, 11 Dec 2008 18:50:30 GMT]]></title><description><![CDATA[<p>IDE?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1629045</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629045</guid><dc:creator><![CDATA[gosha16]]></dc:creator><pubDate>Thu, 11 Dec 2008 18:50:30 GMT</pubDate></item><item><title><![CDATA[Reply to Bin neu in WinAPI und habe probleme mit TextOut() on Thu, 11 Dec 2008 18:51:54 GMT]]></title><description><![CDATA[<p>gosha16 schrieb:</p>
<blockquote>
<p>IDE?</p>
</blockquote>
<p>Please do not make it so complicated to me. I'm new in programming WinAPI.<br />
What do you mean with that question?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1629046</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629046</guid><dc:creator><![CDATA[asmodeus]]></dc:creator><pubDate>Thu, 11 Dec 2008 18:51:54 GMT</pubDate></item><item><title><![CDATA[Reply to Bin neu in WinAPI und habe probleme mit TextOut() on Thu, 11 Dec 2008 18:53:17 GMT]]></title><description><![CDATA[<p>asmodeus schrieb:</p>
<blockquote>
<p>Please do not make it so complicated to me. I'm new in programming WinAPI.<br />
What do you mean with that question?</p>
</blockquote>
<p>Hoppla: Mache es mir doch nicht sdo kompliziert. Ich bin neu in der Programmierung von WinAPI.<br />
Was meinst du mit &quot;IDE?&quot;? Ich kenne kein IDE.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1629048</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629048</guid><dc:creator><![CDATA[asmodeus]]></dc:creator><pubDate>Thu, 11 Dec 2008 18:53:17 GMT</pubDate></item><item><title><![CDATA[Reply to Bin neu in WinAPI und habe probleme mit TextOut() on Thu, 11 Dec 2008 18:53:31 GMT]]></title><description><![CDATA[<p>MS Visual C++? Dev-Cpp? Code Blocks?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1629049</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629049</guid><dc:creator><![CDATA[gosha16]]></dc:creator><pubDate>Thu, 11 Dec 2008 18:53:31 GMT</pubDate></item><item><title><![CDATA[Reply to Bin neu in WinAPI und habe probleme mit TextOut() on Thu, 11 Dec 2008 18:55:26 GMT]]></title><description><![CDATA[<p>gosha16 schrieb:</p>
<blockquote>
<p>MS Visual C++? Dev-Cpp? Code Blocks?</p>
</blockquote>
<p>asmodeus schrieb:</p>
<blockquote>
<p>Wenn ich diesen Code mit Dev-C++ kompiliere, ...</p>
</blockquote>
<p>Ich benutze Dev-C++, wenn du das wissen willst.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1629050</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629050</guid><dc:creator><![CDATA[asmodeus]]></dc:creator><pubDate>Thu, 11 Dec 2008 18:55:26 GMT</pubDate></item><item><title><![CDATA[Reply to Bin neu in WinAPI und habe probleme mit TextOut() on Thu, 11 Dec 2008 18:58:22 GMT]]></title><description><![CDATA[<p>überlesen :p</p>
<p>Geh in die Projektoptionen -&gt; Parameter und bei Linker &quot;Objekt hinzufügen&quot;</p>
<p>im Dev Cpp Verzeichnis im Ordner Lib -&gt; &quot;libgdi32.a&quot; hinzufügen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1629052</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629052</guid><dc:creator><![CDATA[gosha16]]></dc:creator><pubDate>Thu, 11 Dec 2008 18:58:22 GMT</pubDate></item><item><title><![CDATA[Reply to Bin neu in WinAPI und habe probleme mit TextOut() on Thu, 11 Dec 2008 19:02:34 GMT]]></title><description><![CDATA[<p>gosha16 schrieb:</p>
<blockquote>
<p>überlesen :p</p>
<p>Geh in die Projektoptionen -&gt; Parameter und bei Linker &quot;Objekt hinzufügen&quot;</p>
<p>im Dev Cpp Verzeichnis im Ordner Lib -&gt; &quot;libgdi32.a&quot; hinzufügen</p>
</blockquote>
<p>Okay, das Programm wird jetzt ausgeführt.<br />
Aber:<br />
1. Woher weiß ich eigentlich, dass ich dies hinzufügen muss?<br />
2. Es wird zwar ausgeführt, zeichnen tut es aber nichts.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1629056</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629056</guid><dc:creator><![CDATA[asmodeus]]></dc:creator><pubDate>Thu, 11 Dec 2008 19:02:34 GMT</pubDate></item><item><title><![CDATA[Reply to Bin neu in WinAPI und habe probleme mit TextOut() on Thu, 11 Dec 2008 19:09:15 GMT]]></title><description><![CDATA[<p>Neues Win32 Projekt, den Code reinpasten.<br />
Dann gehst du links, direkt neben deinem Code, in diesem Projekt Browser (Wenn du da nichts ist, -&gt; Ansicht und gucken ob beim ersten das Häckchen gesetzt ist) auf den Reiter &quot;Projekt&quot;. Da sollte(muss) dein Projekt sein.<br />
Dann machst du rechtsklick darauf und dann &quot;Projekt Optionen&quot; auswählen. Dann den Reiter &quot;Parameter&quot; auswählen. Dann &quot;libgdi32.a&quot; hinzufügen. Eventuell musst du dich etwas navigieren. Die Datei befindet sich (bei mir) im Ordner &quot;lib&quot; im Dev-Cpp Verzeichnis.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1629064</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629064</guid><dc:creator><![CDATA[Sirrr]]></dc:creator><pubDate>Thu, 11 Dec 2008 19:09:15 GMT</pubDate></item><item><title><![CDATA[Reply to Bin neu in WinAPI und habe probleme mit TextOut() on Thu, 11 Dec 2008 19:14:04 GMT]]></title><description><![CDATA[<p>Sirrr schrieb:</p>
<blockquote>
<p>Neues Win32 Projekt, den Code reinpasten.<br />
Dann gehst du links, direkt neben deinem Code, in diesem Projekt Browser (Wenn du da nichts ist, -&gt; Ansicht und gucken ob beim ersten das Häckchen gesetzt ist) auf den Reiter &quot;Projekt&quot;. Da sollte(muss) dein Projekt sein.<br />
Dann machst du rechtsklick darauf und dann &quot;Projekt Optionen&quot; auswählen. Dann den Reiter &quot;Parameter&quot; auswählen. Dann &quot;libgdi32.a&quot; hinzufügen. Eventuell musst du dich etwas navigieren. Die Datei befindet sich (bei mir) im Ordner &quot;lib&quot; im Dev-Cpp Verzeichnis.</p>
</blockquote>
<p>Hoppla, ich hatte inzwischen &quot;WM_DRAW...&quot; entfernt, funktioniert doch. Danke an alle.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1629076</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1629076</guid><dc:creator><![CDATA[asmodeus]]></dc:creator><pubDate>Thu, 11 Dec 2008 19:14:04 GMT</pubDate></item></channel></rss>