<?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[Access Violation bei CreateWindow]]></title><description><![CDATA[<p>Der folgende Codeabschnitt hat bis heute morgen perfekt funktioniert. Aber aufmal (ohne das ich etwas geändert habe!!) Stürtzt das Programm beim CreateWindow ab</p>
<pre><code class="language-cpp">char szClassName[ ]   = &quot;TexT&quot;;

int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil)
{
    HWND hwnd;
    MSG messages;
    WNDCLASSEX wincl;

//MAIN WND
    wincl.hInstance    = hThisInstance;
    wincl.lpszClassName= szClassName;
    wincl.lpfnWndProc  = WindowProcedure;
    wincl.style        = CS_DBLCLKS;      
    wincl.cbSize       = sizeof(WNDCLASSEX);
    wincl.hIcon        = LoadIcon(NULL, IDI_APPLICATION);
    wincl.hIconSm      = LoadIcon(NULL, IDI_APPLICATION);
    wincl.hCursor      = LoadCursor(NULL, IDC_ARROW);
    wincl.lpszMenuName = &quot;MAINMENU&quot;;
    wincl.cbClsExtra   = 0;  
    wincl.cbWndExtra   = 0;  
    wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
     if(!RegisterClassEx (&amp;wincl))
     {
      MessageBox(NULL,&quot;Fensterklasse konnte nicht Registriert werden&quot;,&quot;Fehler&quot;,MB_OK|MB_ICONSTOP);
      return 0;
     }
/**/MessageBox(NULL,&quot;1&quot;,&quot;&quot;,MB_OK); //Diese Messagebox wird noch aufgerufen
    hwnd = CreateWindowEx(WS_EX_CLIENTEDGE, szClassName, &quot;TexT&quot;, WS_OVERLAPPEDWINDOW, 0, 0, 800, 550, NULL, NULL, hThisInstance, NULL);
/**/MessageBox(NULL,&quot;2&quot;,&quot;&quot;,MB_OK); //Diese leider nicht mehr :(
</code></pre>
<p>Wenn ich auf Debug gehe, zeigt mir VisualStudio folgende Meldung:<br />
&quot;Unbehandelte Ausnahme in TexT.exe: 0xC0000005: Access Violation&quot;</p>
<p>Aber wo?? und Warum jetzt erst??</p>
<p>---<br />
Liegt es evtl an der IDE, das mein (funktioniernder) code nicht funktioniert??</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/118716/access-violation-bei-createwindow</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Jul 2026 11:18:12 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/118716.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 23 Aug 2005 13:38:53 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Access Violation bei CreateWindow on Tue, 23 Aug 2005 13:38:53 GMT]]></title><description><![CDATA[<p>Der folgende Codeabschnitt hat bis heute morgen perfekt funktioniert. Aber aufmal (ohne das ich etwas geändert habe!!) Stürtzt das Programm beim CreateWindow ab</p>
<pre><code class="language-cpp">char szClassName[ ]   = &quot;TexT&quot;;

int WINAPI WinMain (HINSTANCE hThisInstance, HINSTANCE hPrevInstance, LPSTR lpszArgument, int nFunsterStil)
{
    HWND hwnd;
    MSG messages;
    WNDCLASSEX wincl;

//MAIN WND
    wincl.hInstance    = hThisInstance;
    wincl.lpszClassName= szClassName;
    wincl.lpfnWndProc  = WindowProcedure;
    wincl.style        = CS_DBLCLKS;      
    wincl.cbSize       = sizeof(WNDCLASSEX);
    wincl.hIcon        = LoadIcon(NULL, IDI_APPLICATION);
    wincl.hIconSm      = LoadIcon(NULL, IDI_APPLICATION);
    wincl.hCursor      = LoadCursor(NULL, IDC_ARROW);
    wincl.lpszMenuName = &quot;MAINMENU&quot;;
    wincl.cbClsExtra   = 0;  
    wincl.cbWndExtra   = 0;  
    wincl.hbrBackground = (HBRUSH) COLOR_BACKGROUND;
     if(!RegisterClassEx (&amp;wincl))
     {
      MessageBox(NULL,&quot;Fensterklasse konnte nicht Registriert werden&quot;,&quot;Fehler&quot;,MB_OK|MB_ICONSTOP);
      return 0;
     }
/**/MessageBox(NULL,&quot;1&quot;,&quot;&quot;,MB_OK); //Diese Messagebox wird noch aufgerufen
    hwnd = CreateWindowEx(WS_EX_CLIENTEDGE, szClassName, &quot;TexT&quot;, WS_OVERLAPPEDWINDOW, 0, 0, 800, 550, NULL, NULL, hThisInstance, NULL);
/**/MessageBox(NULL,&quot;2&quot;,&quot;&quot;,MB_OK); //Diese leider nicht mehr :(
</code></pre>
<p>Wenn ich auf Debug gehe, zeigt mir VisualStudio folgende Meldung:<br />
&quot;Unbehandelte Ausnahme in TexT.exe: 0xC0000005: Access Violation&quot;</p>
<p>Aber wo?? und Warum jetzt erst??</p>
<p>---<br />
Liegt es evtl an der IDE, das mein (funktioniernder) code nicht funktioniert??</p>
]]></description><link>https://www.c-plusplus.net/forum/post/856930</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/856930</guid><dc:creator><![CDATA[RedEagle]]></dc:creator><pubDate>Tue, 23 Aug 2005 13:38:53 GMT</pubDate></item><item><title><![CDATA[Reply to Access Violation bei CreateWindow on Tue, 23 Aug 2005 14:23:12 GMT]]></title><description><![CDATA[<p>HI !</p>
<p>hab mir dein Code mal Kopiert und bei mir werden beide Message Boxes angezeigt.</p>
<p>Es kann gut sein das deine IDE spinnt (war bei mir auch so konnte ne zeit lang keine Exe mehr builden).</p>
<p>Mach villeicht mal die Funktion Bereinigen :</p>
<p>Im Menü Build auf Clean.</p>
<p>und erstell villeicht mal beide (Debug und Release).</p>
<p>__stdcall*</p>
]]></description><link>https://www.c-plusplus.net/forum/post/856965</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/856965</guid><dc:creator><![CDATA[__stdcall*]]></dc:creator><pubDate>Tue, 23 Aug 2005 14:23:12 GMT</pubDate></item><item><title><![CDATA[Reply to Access Violation bei CreateWindow on Tue, 23 Aug 2005 14:39:03 GMT]]></title><description><![CDATA[<p>Hast du denn eine Menüressource mit String Identifier, die &quot;MAINMENU&quot; heißt? An welcher Stelle im Code tritt denn deine Access Violation auf? Direkt bei CreateWindows also nach der ersten Messagebox?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/856980</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/856980</guid><dc:creator><![CDATA[masterofx32]]></dc:creator><pubDate>Tue, 23 Aug 2005 14:39:03 GMT</pubDate></item><item><title><![CDATA[Reply to Access Violation bei CreateWindow on Tue, 23 Aug 2005 14:42:12 GMT]]></title><description><![CDATA[<p>1. Ja das Menü existiert<br />
2. Die erste MessageBox wird angezeigt, nachdem ich auf &quot;OK&quot; geklickt hab, stürtzt es ab<br />
3. Ich benutze DEV-CPP</p>
<p>Danke, das du es mal getestet hats, __stdcall*. Jetzt weiß ich zumindest, wo ich suchen muss.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/856986</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/856986</guid><dc:creator><![CDATA[RedEagle]]></dc:creator><pubDate>Tue, 23 Aug 2005 14:42:12 GMT</pubDate></item><item><title><![CDATA[Reply to Access Violation bei CreateWindow on Tue, 23 Aug 2005 15:00:02 GMT]]></title><description><![CDATA[<p>__stdcall* schrieb:</p>
<blockquote>
<p>Es kann gut sein das deine IDE spinnt (war bei mir auch so konnte ne zeit lang keine Exe mehr builden).</p>
</blockquote>
<p>Wahrscheinlicher ist allerdings, dass RedEagle irgendwas Böses in WM_CREATE macht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/857006</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/857006</guid><dc:creator><![CDATA[groovemaster]]></dc:creator><pubDate>Tue, 23 Aug 2005 15:00:02 GMT</pubDate></item></channel></rss>