<?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[Beispielcode läuft nicht...]]></title><description><![CDATA[<pre><code>#include &lt;windows.h&gt;

char szKlassenName[] = &quot;Hallo&quot;;

LONG FAR PASCAL _export Auswertung (HWND  hFenster,  WORD wMeldung,   WORD wParam,  LONG lParam)
{
  switch (wMeldung)
  {
    case WM_DESTROY:
      PostQuitMessage(0);
      break;
    default:
      return (DefWindowProc
      (hFenster,  wMeldung,  wParam,  lParam));
  }
  return NULL;
}

BOOL Initialisierung (HANDLE hInstanz)
{
  WNDCLASS FensterKlasse;
  FensterKlasse.style = CS_HREDRAW | CS_VREDRAW;
  FensterKlasse.lpfnWndProc = Auswertung;
  FensterKlasse.cbClsExtra = 0;
  FensterKlasse.hInstance = hInstanz;
  FensterKlasse.hIcon = LoadIcon (NULL, IDI_APPLICATION);
  FensterKlasse.hbrBackground = GetStockObject (WHITE_BRUSH);
  FensterKlasse.lpszMenuName = NULL;
  FensterKlasse.lpszClassName = szKlassenName;

  return (RegisterClass (&amp;FensterKlasse));
}

HWND NeuFenster (HANDLE hInstanz)
{
  HWND hFenster;
  hFenster = CreateWindow(szKlassenName, szKlassenName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstanz, NULL);

  return (hFenster);
}

int PASCAL WinMain (HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
{
  BOOL bKontrolle;
  HWND hFenster;
  MSG Meldung;

  if (!hPrevInstance)
  {
    bKontrolle = Initialisierung (hInstance);
    if (bKontrolle == FALSE)
      return 0;
  }
  else
    return 0;

  hFenster = NeuFenster (hInstance);
  if (!hFenster)
    return 0;
  ShowWindow (hFenster, nCmdShow);

  while (GetMessage (&amp;Meldung, NULL, 0, 0))
  {
    TranslateMessage (&amp;Meldung);
    DispatchMessage (&amp;Meldung);
  }

  return (Meldung.wParam);
}
</code></pre>
<pre><code>In function `LONG Auswertung(HWND__*, WORD, WORD, LONG)':
16: warning: converting to non-pointer type `LONG' from NULL
In function `BOOL Initialisierung(void*)':
23: error: invalid conversion from `LONG (*)(HWND__*, WORD, WORD, LONG)' to `LRESULT (*)(HWND__*, UINT, WPARAM, LPARAM)'
25: error: invalid conversion from `void*' to `HINSTANCE__*'
27: error: invalid conversion from `void*' to `HBRUSH__*'
In function `HWND__* NeuFenster(void*)':
37: error: invalid conversion from `void*' to `HINSTANCE__*'
37: error:   initializing argument 11 of `HWND__* CreateWindowExA(DWORD, const CHAR*, const CHAR*, DWORD, int, int, int, int, HWND__*, HMENU__*, HINSTANCE__*, void*)'
</code></pre>
<p>Handelt sich um Beispilecode aus nem alten Buch, 2.Auflage... Warum läuft das nicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/179797/beispielcode-läuft-nicht</link><generator>RSS for Node</generator><lastBuildDate>Thu, 09 Jul 2026 13:32:11 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/179797.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 25 Apr 2007 13:08:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Beispielcode läuft nicht... on Wed, 25 Apr 2007 13:08:34 GMT]]></title><description><![CDATA[<pre><code>#include &lt;windows.h&gt;

char szKlassenName[] = &quot;Hallo&quot;;

LONG FAR PASCAL _export Auswertung (HWND  hFenster,  WORD wMeldung,   WORD wParam,  LONG lParam)
{
  switch (wMeldung)
  {
    case WM_DESTROY:
      PostQuitMessage(0);
      break;
    default:
      return (DefWindowProc
      (hFenster,  wMeldung,  wParam,  lParam));
  }
  return NULL;
}

BOOL Initialisierung (HANDLE hInstanz)
{
  WNDCLASS FensterKlasse;
  FensterKlasse.style = CS_HREDRAW | CS_VREDRAW;
  FensterKlasse.lpfnWndProc = Auswertung;
  FensterKlasse.cbClsExtra = 0;
  FensterKlasse.hInstance = hInstanz;
  FensterKlasse.hIcon = LoadIcon (NULL, IDI_APPLICATION);
  FensterKlasse.hbrBackground = GetStockObject (WHITE_BRUSH);
  FensterKlasse.lpszMenuName = NULL;
  FensterKlasse.lpszClassName = szKlassenName;

  return (RegisterClass (&amp;FensterKlasse));
}

HWND NeuFenster (HANDLE hInstanz)
{
  HWND hFenster;
  hFenster = CreateWindow(szKlassenName, szKlassenName, WS_OVERLAPPEDWINDOW, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, NULL, NULL, hInstanz, NULL);

  return (hFenster);
}

int PASCAL WinMain (HANDLE hInstance, HANDLE hPrevInstance, LPSTR lpszCmdLine, int nCmdShow)
{
  BOOL bKontrolle;
  HWND hFenster;
  MSG Meldung;

  if (!hPrevInstance)
  {
    bKontrolle = Initialisierung (hInstance);
    if (bKontrolle == FALSE)
      return 0;
  }
  else
    return 0;

  hFenster = NeuFenster (hInstance);
  if (!hFenster)
    return 0;
  ShowWindow (hFenster, nCmdShow);

  while (GetMessage (&amp;Meldung, NULL, 0, 0))
  {
    TranslateMessage (&amp;Meldung);
    DispatchMessage (&amp;Meldung);
  }

  return (Meldung.wParam);
}
</code></pre>
<pre><code>In function `LONG Auswertung(HWND__*, WORD, WORD, LONG)':
16: warning: converting to non-pointer type `LONG' from NULL
In function `BOOL Initialisierung(void*)':
23: error: invalid conversion from `LONG (*)(HWND__*, WORD, WORD, LONG)' to `LRESULT (*)(HWND__*, UINT, WPARAM, LPARAM)'
25: error: invalid conversion from `void*' to `HINSTANCE__*'
27: error: invalid conversion from `void*' to `HBRUSH__*'
In function `HWND__* NeuFenster(void*)':
37: error: invalid conversion from `void*' to `HINSTANCE__*'
37: error:   initializing argument 11 of `HWND__* CreateWindowExA(DWORD, const CHAR*, const CHAR*, DWORD, int, int, int, int, HWND__*, HMENU__*, HINSTANCE__*, void*)'
</code></pre>
<p>Handelt sich um Beispilecode aus nem alten Buch, 2.Auflage... Warum läuft das nicht?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1273203</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1273203</guid><dc:creator><![CDATA[&amp;lt;username&amp;gt;]]></dc:creator><pubDate>Wed, 25 Apr 2007 13:08:34 GMT</pubDate></item><item><title><![CDATA[Reply to Beispielcode läuft nicht... on Wed, 25 Apr 2007 14:01:22 GMT]]></title><description><![CDATA[<p>Altes Buch 2. Auflage kenn ich leider nicht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1273267</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1273267</guid><dc:creator><![CDATA[ggf]]></dc:creator><pubDate>Wed, 25 Apr 2007 14:01:22 GMT</pubDate></item><item><title><![CDATA[Reply to Beispielcode läuft nicht... on Wed, 25 Apr 2007 14:07:30 GMT]]></title><description><![CDATA[<p>(turbo) borland c++ 3.0 f. Win</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1273276</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1273276</guid><dc:creator><![CDATA[alter]]></dc:creator><pubDate>Wed, 25 Apr 2007 14:07:30 GMT</pubDate></item><item><title><![CDATA[Reply to Beispielcode läuft nicht... on Wed, 25 Apr 2007 14:08:40 GMT]]></title><description><![CDATA[<p>Ich nehm zum Testen bcc32 5.5...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1273277</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1273277</guid><dc:creator><![CDATA[&amp;lt;username&amp;gt;]]></dc:creator><pubDate>Wed, 25 Apr 2007 14:08:40 GMT</pubDate></item><item><title><![CDATA[Reply to Beispielcode läuft nicht... on Wed, 25 Apr 2007 19:02:19 GMT]]></title><description><![CDATA[<p>Vergiss den Code der ist wirklich uralt ... sieht alles stark nach 16-Bit aus, nimm den: <a href="http://winapi.net/index.php?inhalt=tipp1" rel="nofollow">http://winapi.net/index.php?inhalt=tipp1</a></p>
<p>PS: Was ist das eigentlich für ne Angabe: &quot;Beispilecode aus nem alten Buch, 2.Auflage&quot; <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f62e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_open_mouth"
      title=":open_mouth:"
      alt="😮"
    /> ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1273519</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1273519</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Wed, 25 Apr 2007 19:02:19 GMT</pubDate></item></channel></rss>