<?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[Fenster kann nicht erstellt werden]]></title><description><![CDATA[<p>Hi,<br />
es handelt sich um folgendes, ich versuche ein Fenster zu erstellen,<br />
ich kann es ohne fehler Kompilieren und Linken und zur Laufzeit stürtzt es auch nicht nicht ab, aber ich bekomme die Meldung &quot;Fensterklasse konnte nicht registriert werden&quot; &amp; &quot;Fenster konnte nicht erfolgreich erstellt werden&quot;.<br />
Ich habe schon alles mögliche ausprobiert, aber es passiert nichts. <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 />
ich benutze Dev C++ 4.9.9.2</p>
<p>Hier ist der Code</p>
<pre><code class="language-cpp">tcWindow *tcWin32_System::tcCreateWindow(const char *title, int Width, int Height,
                                         int Left, int Top, int Bpp, bool bFullscreen)
{
    tcWindow *pWindow = NULL;
    WNDCLASSEX WindowClass;
    HINSTANCE hInstance;
    DWORD dwStyle;

    //Fenster-Instanz erstellen
    pWindow = new tcWindow;

    //Werte setzen
    pWindow-&gt;title       = (char*)title;
    pWindow-&gt;Width       = Width;
    pWindow-&gt;Height      = Height;
    pWindow-&gt;Left        = Left;
    pWindow-&gt;Top         = Top;
    pWindow-&gt;Bpp         = Bpp;
    pWindow-&gt;bFullscreen = bFullscreen;

    //Instanz holen
    hInstance = GetModuleHandle(NULL);

    //Fensterklasse zurücksetzen
    ZeroMemory(&amp;WindowClass, sizeof(WNDCLASSEX));

    //Fensterklasse erstellen
    WindowClass.cbSize        = sizeof(WNDCLASSEX);
    WindowClass.style         = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
    WindowClass.lpfnWndProc   = (WNDPROC)WndProc;
    WindowClass.cbClsExtra    = 0;

    WindowClass.cbWndExtra    = 0;
    WindowClass.hInstance     = hInstance;
    WindowClass.hIcon         = LoadIcon(NULL, IDI_WINLOGO);
    WindowClass.hCursor       = LoadCursor(NULL, IDC_ARROW);
    WindowClass.hbrBackground = NULL;
    WindowClass.lpszMenuName  = NULL;
    WindowClass.lpszClassName = &quot;ToxiCore-Window&quot;;
    WindowClass.hIconSm       = NULL;

    //Fensterklasse registrieren
    if (!RegisterClassEx(&amp;WindowClass))
    {
        cout &lt;&lt; &quot;Fensterklase wurde registriert&quot; &lt;&lt; endl;
    }
    else
    {
        cout &lt;&lt; &quot;Fensterklasse konnte nicht registriert werden&quot; &lt;&lt; endl;
    }

    if (pWindow-&gt;bFullscreen == true)
    {
        //Der Style für den Vollbildmodus
        dwStyle = WS_POPUP;
    }
    else
    {
        //Der Style für den Fenstermodus
        dwStyle = WS_OVERLAPPEDWINDOW;
    }

    //Fenster erstellen
    m_hWnd = CreateWindowEx(NULL, &quot;ToxiCore-Window&quot;, pWindow-&gt;title,
                            dwStyle, pWindow-&gt;Left, pWindow-&gt;Top,
                            pWindow-&gt;Width, pWindow-&gt;Height,
                            NULL, NULL, hInstance, NULL);

    //Überprüfen
    if (m_hWnd == NULL)
    {
        cout &lt;&lt; &quot;Fenster konnte nicht erfolgreich erstellt werden&quot; &lt;&lt; endl;
        tcDestroyWindow(pWindow);
    }
    else
    {
        cout &lt;&lt; &quot;Fenster wurde erfolgreich erstellt&quot; &lt;&lt; endl;
    }

    //Fenster instanz speichern
    SetWindowLong(m_hWnd, GWL_USERDATA, (long)this);

    ShowWindow(m_hWnd, SW_SHOW);
    SetFocus(m_hWnd);
    UpdateWindow(m_hWnd);

    return pWindow;
}
</code></pre>
<p>[EDIT]Nachrichtenschleife wurde entfernt[/EDIT]</p>
<p>Wo ist da der Fehler?? <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="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/topic/116838/fenster-kann-nicht-erstellt-werden</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 06:52:56 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/116838.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 31 Jul 2005 17:02:47 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fenster kann nicht erstellt werden on Sun, 31 Jul 2005 17:30:02 GMT]]></title><description><![CDATA[<p>Hi,<br />
es handelt sich um folgendes, ich versuche ein Fenster zu erstellen,<br />
ich kann es ohne fehler Kompilieren und Linken und zur Laufzeit stürtzt es auch nicht nicht ab, aber ich bekomme die Meldung &quot;Fensterklasse konnte nicht registriert werden&quot; &amp; &quot;Fenster konnte nicht erfolgreich erstellt werden&quot;.<br />
Ich habe schon alles mögliche ausprobiert, aber es passiert nichts. <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 />
ich benutze Dev C++ 4.9.9.2</p>
<p>Hier ist der Code</p>
<pre><code class="language-cpp">tcWindow *tcWin32_System::tcCreateWindow(const char *title, int Width, int Height,
                                         int Left, int Top, int Bpp, bool bFullscreen)
{
    tcWindow *pWindow = NULL;
    WNDCLASSEX WindowClass;
    HINSTANCE hInstance;
    DWORD dwStyle;

    //Fenster-Instanz erstellen
    pWindow = new tcWindow;

    //Werte setzen
    pWindow-&gt;title       = (char*)title;
    pWindow-&gt;Width       = Width;
    pWindow-&gt;Height      = Height;
    pWindow-&gt;Left        = Left;
    pWindow-&gt;Top         = Top;
    pWindow-&gt;Bpp         = Bpp;
    pWindow-&gt;bFullscreen = bFullscreen;

    //Instanz holen
    hInstance = GetModuleHandle(NULL);

    //Fensterklasse zurücksetzen
    ZeroMemory(&amp;WindowClass, sizeof(WNDCLASSEX));

    //Fensterklasse erstellen
    WindowClass.cbSize        = sizeof(WNDCLASSEX);
    WindowClass.style         = CS_HREDRAW | CS_VREDRAW | CS_OWNDC;
    WindowClass.lpfnWndProc   = (WNDPROC)WndProc;
    WindowClass.cbClsExtra    = 0;

    WindowClass.cbWndExtra    = 0;
    WindowClass.hInstance     = hInstance;
    WindowClass.hIcon         = LoadIcon(NULL, IDI_WINLOGO);
    WindowClass.hCursor       = LoadCursor(NULL, IDC_ARROW);
    WindowClass.hbrBackground = NULL;
    WindowClass.lpszMenuName  = NULL;
    WindowClass.lpszClassName = &quot;ToxiCore-Window&quot;;
    WindowClass.hIconSm       = NULL;

    //Fensterklasse registrieren
    if (!RegisterClassEx(&amp;WindowClass))
    {
        cout &lt;&lt; &quot;Fensterklase wurde registriert&quot; &lt;&lt; endl;
    }
    else
    {
        cout &lt;&lt; &quot;Fensterklasse konnte nicht registriert werden&quot; &lt;&lt; endl;
    }

    if (pWindow-&gt;bFullscreen == true)
    {
        //Der Style für den Vollbildmodus
        dwStyle = WS_POPUP;
    }
    else
    {
        //Der Style für den Fenstermodus
        dwStyle = WS_OVERLAPPEDWINDOW;
    }

    //Fenster erstellen
    m_hWnd = CreateWindowEx(NULL, &quot;ToxiCore-Window&quot;, pWindow-&gt;title,
                            dwStyle, pWindow-&gt;Left, pWindow-&gt;Top,
                            pWindow-&gt;Width, pWindow-&gt;Height,
                            NULL, NULL, hInstance, NULL);

    //Überprüfen
    if (m_hWnd == NULL)
    {
        cout &lt;&lt; &quot;Fenster konnte nicht erfolgreich erstellt werden&quot; &lt;&lt; endl;
        tcDestroyWindow(pWindow);
    }
    else
    {
        cout &lt;&lt; &quot;Fenster wurde erfolgreich erstellt&quot; &lt;&lt; endl;
    }

    //Fenster instanz speichern
    SetWindowLong(m_hWnd, GWL_USERDATA, (long)this);

    ShowWindow(m_hWnd, SW_SHOW);
    SetFocus(m_hWnd);
    UpdateWindow(m_hWnd);

    return pWindow;
}
</code></pre>
<p>[EDIT]Nachrichtenschleife wurde entfernt[/EDIT]</p>
<p>Wo ist da der Fehler?? <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="😕"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/842857</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842857</guid><dc:creator><![CDATA[ToxiCore]]></dc:creator><pubDate>Sun, 31 Jul 2005 17:30:02 GMT</pubDate></item><item><title><![CDATA[Reply to Fenster kann nicht erstellt werden on Sun, 31 Jul 2005 17:22:57 GMT]]></title><description><![CDATA[<p>Poste nicht soviel sinnlosen Code. Wenn die Fensterklasse nicht registriert werden kann, dann zeig nur den Code wo du die Fensterklasse registrierst. Was sagt GetLastError?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/842873</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842873</guid><dc:creator><![CDATA[exit(0)]]></dc:creator><pubDate>Sun, 31 Jul 2005 17:22:57 GMT</pubDate></item><item><title><![CDATA[Reply to Fenster kann nicht erstellt werden on Sun, 31 Jul 2005 17:31:21 GMT]]></title><description><![CDATA[<blockquote>
<p>Was sagt GetLastError?</p>
</blockquote>
<p>GetlastError() = 2</p>
]]></description><link>https://www.c-plusplus.net/forum/post/842882</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842882</guid><dc:creator><![CDATA[ToxiCore]]></dc:creator><pubDate>Sun, 31 Jul 2005 17:31:21 GMT</pubDate></item><item><title><![CDATA[Reply to Fenster kann nicht erstellt werden on Sun, 31 Jul 2005 17:37:51 GMT]]></title><description><![CDATA[<p>mach ein beispiel ohne die klasse drumherum das sich kompilieren lässt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/842885</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842885</guid><dc:creator><![CDATA[minimalistic]]></dc:creator><pubDate>Sun, 31 Jul 2005 17:37:51 GMT</pubDate></item><item><title><![CDATA[Reply to Fenster kann nicht erstellt werden on Mon, 01 Aug 2005 01:02:36 GMT]]></title><description><![CDATA[<p>Entfern mal das Ausrufezeichen vor RegisterClassEx(&amp;WindowClass)...</p>
<p>Walter</p>
]]></description><link>https://www.c-plusplus.net/forum/post/843096</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/843096</guid><dc:creator><![CDATA[Walter Z]]></dc:creator><pubDate>Mon, 01 Aug 2005 01:02:36 GMT</pubDate></item></channel></rss>