<?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[bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung]]></title><description><![CDATA[<p>Ich schreib grad ein kleines prog bei dem ich kurz ein fenster brauch, aber es klappt nicht so richtig.<br />
Na ja, das Fenster und so klappt alles, nur beim beenden kommt immer ein Fehler, vonwegen &quot;The Value of ESP was not properly saved across a function call&quot; und zwar, wenn ich die funktion</p>
<pre><code class="language-cpp">DestroyWindow(hWnd);
</code></pre>
<p>aufruf.<br />
Mach ich da was falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/85757/bei-destroywindow-hwnd-kommt-immer-eine-fehlermeldung</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 11:16:22 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/85757.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 12 Sep 2004 20:37:50 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Sun, 12 Sep 2004 20:37:50 GMT]]></title><description><![CDATA[<p>Ich schreib grad ein kleines prog bei dem ich kurz ein fenster brauch, aber es klappt nicht so richtig.<br />
Na ja, das Fenster und so klappt alles, nur beim beenden kommt immer ein Fehler, vonwegen &quot;The Value of ESP was not properly saved across a function call&quot; und zwar, wenn ich die funktion</p>
<pre><code class="language-cpp">DestroyWindow(hWnd);
</code></pre>
<p>aufruf.<br />
Mach ich da was falsch?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/605524</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/605524</guid><dc:creator><![CDATA[_gast_]]></dc:creator><pubDate>Sun, 12 Sep 2004 20:37:50 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Sun, 12 Sep 2004 20:41:54 GMT]]></title><description><![CDATA[<p>liegt bestimmt nicht an dieser zeile</p>
]]></description><link>https://www.c-plusplus.net/forum/post/605531</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/605531</guid><dc:creator><![CDATA[woanders]]></dc:creator><pubDate>Sun, 12 Sep 2004 20:41:54 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Sun, 12 Sep 2004 21:10:30 GMT]]></title><description><![CDATA[<p>die datei, wo die funktionen stehen</p>
<pre><code class="language-cpp">WNDCLASSEX wndClass;
HWND hWnd;
int Maximized;
char Name[5];

HRESULT OpenWindow(int Windowed, WNDPROC MsgProc, HINSTANCE Inst, char* Title)
{
  strcpy(Name, Title);
  Maximized = !Windowed;
  wndClass.cbSize = sizeof(WNDCLASSEX);
  wndClass.cbClsExtra = NULL;
  wndClass.cbWndExtra = NULL;
  wndClass.style = CS_HREDRAW | CS_VREDRAW;
  wndClass.hCursor = NULL;
  wndClass.hIcon = NULL;
  wndClass.hIconSm = NULL;
  wndClass.hInstance = Inst;
  wndClass.lpszMenuName = NULL;
  wndClass.lpszClassName = APP_CLASSNAME;
  wndClass.hbrBackground = (HBRUSH)GetStockObject(BLACK_BRUSH);
  wndClass.lpfnWndProc = MsgProc;

  ShowCursor(FALSE);

  RegisterClassEx(&amp;wndClass);

  if (!Windowed)
  {
    if ((hWnd = CreateWindow(APP_CLASSNAME, Title, WS_MAXIMIZE | WS_VISIBLE | WS_POPUP,
        100, 100, 500, 500, GetDesktopWindow(), NULL, Inst, NULL)) == 0)
    return APP_E_HANDLE;
  }
  else
    if ((hWnd = CreateWindow(APP_CLASSNAME, Title, WS_POPUP | WS_VISIBLE | WS_OVERLAPPEDWINDOW,
        100, 100, 500, 500, GetDesktopWindow(), NULL, Inst, NULL)) == 0)
    return APP_E_HANDLE;

  return SUCCESS;
}

void ProcessMessages()
{
  MSG msg;
  while (PeekMessage(&amp;msg, NULL, 0, 0, PM_REMOVE))
  {
    TranslateMessage(&amp;msg);
    DispatchMessage(&amp;msg);
  }

}

void CloseWindow()
{
  PostMessage(hWnd, WM_CLOSE, 0, 0);
  UnregisterClass(APP_CLASSNAME, wndClass.hInstance);
}

void SwitchMaxim()
{
  Maximized = !Maximized;
  DestroyWindow(hWnd);
  if (Maximized)
  {
    if ((hWnd = CreateWindow(APP_CLASSNAME, Name, WS_MAXIMIZE | WS_VISIBLE | WS_POPUP,
        100, 100, 500, 500, GetDesktopWindow(), NULL, wndClass.hInstance, NULL)) == 0)
    return;
  }
  else
    if ((hWnd = CreateWindow(APP_CLASSNAME, Name, WS_POPUP | WS_VISIBLE | WS_OVERLAPPEDWINDOW,
        100, 100, 500, 500, GetDesktopWindow(), NULL, wndClass.hInstance, NULL)) == 0)
    return;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/605560</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/605560</guid><dc:creator><![CDATA[_gast_]]></dc:creator><pubDate>Sun, 12 Sep 2004 21:10:30 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Sun, 12 Sep 2004 21:15:18 GMT]]></title><description><![CDATA[<p>benutzt du irgendwo LoadLibrary und GetProcAddress?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/605562</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/605562</guid><dc:creator><![CDATA[?????]]></dc:creator><pubDate>Sun, 12 Sep 2004 21:15:18 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Sun, 12 Sep 2004 21:20:31 GMT]]></title><description><![CDATA[<p>das ganze liegt in 'ner dll, warum?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/605566</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/605566</guid><dc:creator><![CDATA[_gast_]]></dc:creator><pubDate>Sun, 12 Sep 2004 21:20:31 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Sun, 12 Sep 2004 21:26:02 GMT]]></title><description><![CDATA[<p>dann liegt es vielleicht am programm das die dll benutzt. sofern du da LoadLibrary/GetProcAddress benutzt</p>
]]></description><link>https://www.c-plusplus.net/forum/post/605571</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/605571</guid><dc:creator><![CDATA[loadlib]]></dc:creator><pubDate>Sun, 12 Sep 2004 21:26:02 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Sun, 12 Sep 2004 21:31:12 GMT]]></title><description><![CDATA[<p>Die Pointer auf die Funktion stimmen. Ich bin deshalb der Meinung, dass es bei der DestroyWindow fehlt, weil ich die funktion in SwitchMaxim() rausgenommen hab unds da ganz gut geklappt hat... (wenn ich SwitchMaxim aufgerufen hab)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/605573</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/605573</guid><dc:creator><![CDATA[_gast_]]></dc:creator><pubDate>Sun, 12 Sep 2004 21:31:12 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Sun, 12 Sep 2004 21:32:38 GMT]]></title><description><![CDATA[<p>überprüf mal die calling conventions. __stdcall/WINAPI oder __cdecl</p>
]]></description><link>https://www.c-plusplus.net/forum/post/605574</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/605574</guid><dc:creator><![CDATA[decl]]></dc:creator><pubDate>Sun, 12 Sep 2004 21:32:38 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Mon, 13 Sep 2004 06:48:47 GMT]]></title><description><![CDATA[<p>Ist den hWnd zu diesem Zeitpunkt überhaupt ein gültiges Handle?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/605651</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/605651</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Mon, 13 Sep 2004 06:48:47 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Mon, 13 Sep 2004 08:33:52 GMT]]></title><description><![CDATA[<p>decl schrieb:</p>
<blockquote>
<p>überprüf mal die calling conventions. __stdcall/WINAPI oder __cdecl</p>
</blockquote>
<p><strong>Das</strong> ist ein ganz heißer Tip! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f4a1.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--light_bulb"
      title=":bulb:"
      alt="💡"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f44d.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--thumbs_up"
      title=":+1:"
      alt="👍"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/605735</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/605735</guid><dc:creator><![CDATA[Hepi]]></dc:creator><pubDate>Mon, 13 Sep 2004 08:33:52 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Mon, 13 Sep 2004 10:18:19 GMT]]></title><description><![CDATA[<p><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>
]]></description><link>https://www.c-plusplus.net/forum/post/605749</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/605749</guid><dc:creator><![CDATA[decl]]></dc:creator><pubDate>Mon, 13 Sep 2004 10:18:19 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Mon, 13 Sep 2004 14:53:55 GMT]]></title><description><![CDATA[<p>1. Was genau sind &quot;calling conventions&quot;? (Ich hab die Hilfe nur auf Englisch und bin da nicht so gut<br />
2. Wie überprüf ich die?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/606162</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/606162</guid><dc:creator><![CDATA[_gast_]]></dc:creator><pubDate>Mon, 13 Sep 2004 14:53:55 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Mon, 13 Sep 2004 15:19:44 GMT]]></title><description><![CDATA[<p><em>gast</em> schrieb:</p>
<blockquote>
<p>1. Was genau sind &quot;calling conventions&quot;?</p>
</blockquote>
<p>Die calling convention legt fest, wie der Compiler die Parameter übergibt (von rechts nach links oder andersrum), wer für den Stack verantwortlich ist und so ein Kram. Wenn man beim Aufrufen eine andere calling convention benutzt als beim deklarieren, stürzt das Programm meistens ab.</p>
<blockquote>
<p>(Ich hab die Hilfe nur auf Englisch und bin da nicht so gut</p>
</blockquote>
<p>btw: Englisch wirst du lernen müssen, wenn du programmieren willst. Ein Großteil der Fachliteratur ist in Englisch verfasst.</p>
<blockquote>
<p>2. Wie überprüf ich die?</p>
</blockquote>
<p>Schau nach, ob WINAPI, CALLBACK, __cdecl o.ä. vor der Funktion steht (je nachdem, was benötigt wird).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/606185</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/606185</guid><dc:creator><![CDATA[Christoph]]></dc:creator><pubDate>Mon, 13 Sep 2004 15:19:44 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Wed, 15 Sep 2004 11:39:04 GMT]]></title><description><![CDATA[<p>Folgendes:<br />
Am Aufruf der Funktion DestroyWindow liegts auch nicht, denn mit</p>
<pre><code class="language-cpp">PostMessage(hWnd, WM_CLOSE, 0, 0);
  UnregisterClass(APP_CLASSNAME, wndClass.hInstance);
</code></pre>
<p>krieg ich die selbe Fehlermeldung -&gt; es könnt am handle liegn. Das CreateWindow funktioniert aber, wie krieg ich raus, ob es sich um ein gültiges Handle handelt?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/607731</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/607731</guid><dc:creator><![CDATA[_gast_]]></dc:creator><pubDate>Wed, 15 Sep 2004 11:39:04 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Wed, 15 Sep 2004 13:15:10 GMT]]></title><description><![CDATA[<p><a href="http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/iswindow.asp" rel="nofollow">IsWindow</a> <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>
]]></description><link>https://www.c-plusplus.net/forum/post/607818</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/607818</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Wed, 15 Sep 2004 13:15:10 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Wed, 15 Sep 2004 14:10:31 GMT]]></title><description><![CDATA[<p>des Handle isn window <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /><br />
woran könnts sonst noch liegen? (mir fällt irgendwie keine andere möglichkeit ein)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/607886</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/607886</guid><dc:creator><![CDATA[_gast_]]></dc:creator><pubDate>Wed, 15 Sep 2004 14:10:31 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Wed, 15 Sep 2004 15:26:46 GMT]]></title><description><![CDATA[<p>schön das du das mit den calling conventions ignorierst...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/607964</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/607964</guid><dc:creator><![CDATA[schöner]]></dc:creator><pubDate>Wed, 15 Sep 2004 15:26:46 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Wed, 15 Sep 2004 16:06:09 GMT]]></title><description><![CDATA[<p>schöner schrieb:</p>
<blockquote>
<p>schön das du das mit den calling conventions ignorierst...</p>
</blockquote>
<p>...zumal es genau des Rätsels Lösung ist.</p>
<p><a href="http://softwareforums.intel.com/ids/board/message?board.id=15&amp;message.id=434" rel="nofollow">Beispiel für einen bei Google gefundenen Link</a></p>
<p>Oder halt selber mal bei <a href="http://www.google.de/search?sourceid=navclient&amp;hl=de&amp;ie=UTF-8&amp;q=The+Value+of+ESP+was+not+properly+saved" rel="nofollow">Google nach &quot;The Value of ESP was not properly saved&quot; suchen...</a></p>
<p>Aber man kann natürlich auch weiterhin an der falschen Ecke herumdoktorn... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
<p>ESP heißt übrigens &quot;Extended Stack Pointer&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/607989</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/607989</guid><dc:creator><![CDATA[Hepi]]></dc:creator><pubDate>Wed, 15 Sep 2004 16:06:09 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Thu, 16 Sep 2004 15:20:12 GMT]]></title><description><![CDATA[<p>Hepi schrieb:</p>
<blockquote>
<p>schöner schrieb:</p>
<blockquote>
<p>schön das du das mit den calling conventions ignorierst...</p>
</blockquote>
<p>...zumal es genau des Rätsels Lösung ist.</p>
<p><a href="http://softwareforums.intel.com/ids/board/message?board.id=15&amp;message.id=434" rel="nofollow">Beispiel für einen bei Google gefundenen Link</a></p>
<p>Oder halt selber mal bei <a href="http://www.google.de/search?sourceid=navclient&amp;hl=de&amp;ie=UTF-8&amp;q=The+Value+of+ESP+was+not+properly+saved" rel="nofollow">Google nach &quot;The Value of ESP was not properly saved&quot; suchen...</a></p>
<p>Aber man kann natürlich auch weiterhin an der falschen Ecke herumdoktorn... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
<p>ESP heißt übrigens &quot;Extended Stack Pointer&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>
</blockquote>
<p>Ok:<br />
Warum ich nicht glaube, dasses beim Aufruf der Funktion in der DLL liegt.<br />
folgende Funktion ist in einer DLL gespeichert und wird über den Pointer auf die Funktion aufgerufen:</p>
<pre><code class="language-cpp">void CloseWindow()
{
  return;
}
</code></pre>
<p>Der Aufruf klappt Perfekt, es gibt kein problem, keine Fehlermeldung.<br />
nun füge ich die (meiner meinung nach Problem-)zeile hinzu</p>
<pre><code class="language-cpp">void CloseWindow()
{
  DestroyWindow(hWnd);
}
</code></pre>
<p>kompiliere die DLL neu, führ das Prog nochmal aus und tada, kommt die Fehlermeldung.<br />
Das selbe kommt übrigens, wenn ich das fenster anders schließen will:</p>
<pre><code class="language-cpp">void CloseWindow()
{
  PostMessage(hWnd, WM_CLOSE, 0, 0);
  UnregisterClass(APP_CLASSNAME, wndClass.hInstance);
}
</code></pre>
<p>Ich weiß nicht, obs an mir, den Calling Conventions oder was anderem liegt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/608450</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/608450</guid><dc:creator><![CDATA[_gast_]]></dc:creator><pubDate>Thu, 16 Sep 2004 15:20:12 GMT</pubDate></item><item><title><![CDATA[Reply to bei DestroyWindow(hWnd) kommt immer eine Fehlermeldung on Thu, 16 Sep 2004 15:41:58 GMT]]></title><description><![CDATA[<p><em>gast</em> schrieb:</p>
<blockquote>
<p>Ich weiß nicht, obs an mir, den Calling Conventions oder was anderem liegt.</p>
</blockquote>
<p>Aber wir wissen es.</p>
<p>Und wir haben es Dir nun oft genug gesagt.</p>
<p>Da Du es nachhaltig ignorierst, liegt es auch an Dir und nicht nur an den Calling Conventions, da könntest Du allerdings Recht haben... <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/608466</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/608466</guid><dc:creator><![CDATA[Hepi]]></dc:creator><pubDate>Thu, 16 Sep 2004 15:41:58 GMT</pubDate></item></channel></rss>