<?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[Prob bei CreateWindowEx]]></title><description><![CDATA[<p>Hmm DevC++ zeigt mir bei folgenden Code einen Fehler an:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

// CallBack Funktion zum Verwalten von Nachrichten 
LRESULT CALLBACK WinProc(HWND   hWnd,
                         UINT   msg,
                         WPARAM wParam,
                         LPARAM lParam);

// Main Funktion
int WINAPI WinMain(HINSTANCE hInstance,
                   HINSTANCE hPrevInstance,
                   LPSTR     lpCmdLine,
                   int       nCmdShow)
{
    WNDCLASSEX wndClass;
    HWND hWnd;
    MSG  msg;

    // WindowClassExtended Struktur
    wndClass.cbSize        = sizeof(WNDCLASSEX);
    wndClass.style         = CS_DBLCLKS |
                             CS_OWNDC   |
                             CS_HREDRAW |
                             CS_VREDRAW;
    wndClass.lpfnWndProc   = WinProc;
    wndClass.cbClsExtra    = 0;
    wndClass.cbWndExtra    = 0;
    wndClass.hInstance     = hInstance;
    wndClass.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
    wndClass.hCursor       = LoadCursor(NULL, IDC_HAND);
    wndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
    wndClass.lpszMenuName  = NULL;
    wndClass.lpszClassName = &quot;Windowklasse&quot;;
    wndClass.hIconSm       = LoadIcon(NULL, IDI_APPLICATION);

    // Klasse registrieren
    if (!RegisterClassEx(&amp;wndClass))
    {
        MessageBox(0, &quot;Klasse konnte nicht registriert werden&quot;,
                   &quot;Fehler&quot;, MB_OK);
        return 0;
    }    

    // Fenster erstellen
    if (!(hWnd = CreateWindowEx(NULL,
                                &quot;Windowklasse&quot;,
                                &quot;Das erste Windows Fenster&quot;,
                                WS_OVERLAPPEDWINDOW | WS_VISIBLE,
                                10,  10,
                                400, 300,
                                NULL,
                                NULL,
                                hInstance,
                                NULL))) // &lt;-- hier ist der Fehler
    {
        MessageBox(0, &quot;Fenster konnte nicht erstellt werden&quot;,
                   &quot;Fehler&quot;, MB_OK);
        return(0);
    }       

    // Hauptschleife
    while(GetMessage(&amp;msg, NULL, 0, 0))
    {
        TranslateMessage(&amp;msg);
        DispatchMessage(&amp;msg);
    }

    // Fertig
    return 0;
}

// CallBack Funktion zum auswerten der Nachrichten
LRESULT CALLBACK WinProc(HWND   hWnd,
                         UINT   msg,
                         WPARAM wParam,
                         LPARAM lParam)
{
    switch(msg)
    {
        case WM_DESTROY:
            PostQuitMessage(0);
            return 0;
            break;
    }

    return DefWindowProc(hWnd, msg, wParam, lParam);
}
</code></pre>
<p>Ich verstehe einfach nicht, warum er Mucken macht bei LPVOID NULL einzusetzen. Das Template von DevC++ funktioniert ja auch mit NULL und lässt sich kompilieren.<br />
mfg olli</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/90962/prob-bei-createwindowex</link><generator>RSS for Node</generator><lastBuildDate>Wed, 22 Apr 2026 04:54:40 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/90962.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 03 Nov 2004 21:02:04 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Prob bei CreateWindowEx on Wed, 03 Nov 2004 21:02:54 GMT]]></title><description><![CDATA[<p>Hmm DevC++ zeigt mir bei folgenden Code einen Fehler an:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

// CallBack Funktion zum Verwalten von Nachrichten 
LRESULT CALLBACK WinProc(HWND   hWnd,
                         UINT   msg,
                         WPARAM wParam,
                         LPARAM lParam);

// Main Funktion
int WINAPI WinMain(HINSTANCE hInstance,
                   HINSTANCE hPrevInstance,
                   LPSTR     lpCmdLine,
                   int       nCmdShow)
{
    WNDCLASSEX wndClass;
    HWND hWnd;
    MSG  msg;

    // WindowClassExtended Struktur
    wndClass.cbSize        = sizeof(WNDCLASSEX);
    wndClass.style         = CS_DBLCLKS |
                             CS_OWNDC   |
                             CS_HREDRAW |
                             CS_VREDRAW;
    wndClass.lpfnWndProc   = WinProc;
    wndClass.cbClsExtra    = 0;
    wndClass.cbWndExtra    = 0;
    wndClass.hInstance     = hInstance;
    wndClass.hIcon         = LoadIcon(NULL, IDI_APPLICATION);
    wndClass.hCursor       = LoadCursor(NULL, IDC_HAND);
    wndClass.hbrBackground = (HBRUSH)GetStockObject(WHITE_BRUSH);
    wndClass.lpszMenuName  = NULL;
    wndClass.lpszClassName = &quot;Windowklasse&quot;;
    wndClass.hIconSm       = LoadIcon(NULL, IDI_APPLICATION);

    // Klasse registrieren
    if (!RegisterClassEx(&amp;wndClass))
    {
        MessageBox(0, &quot;Klasse konnte nicht registriert werden&quot;,
                   &quot;Fehler&quot;, MB_OK);
        return 0;
    }    

    // Fenster erstellen
    if (!(hWnd = CreateWindowEx(NULL,
                                &quot;Windowklasse&quot;,
                                &quot;Das erste Windows Fenster&quot;,
                                WS_OVERLAPPEDWINDOW | WS_VISIBLE,
                                10,  10,
                                400, 300,
                                NULL,
                                NULL,
                                hInstance,
                                NULL))) // &lt;-- hier ist der Fehler
    {
        MessageBox(0, &quot;Fenster konnte nicht erstellt werden&quot;,
                   &quot;Fehler&quot;, MB_OK);
        return(0);
    }       

    // Hauptschleife
    while(GetMessage(&amp;msg, NULL, 0, 0))
    {
        TranslateMessage(&amp;msg);
        DispatchMessage(&amp;msg);
    }

    // Fertig
    return 0;
}

// CallBack Funktion zum auswerten der Nachrichten
LRESULT CALLBACK WinProc(HWND   hWnd,
                         UINT   msg,
                         WPARAM wParam,
                         LPARAM lParam)
{
    switch(msg)
    {
        case WM_DESTROY:
            PostQuitMessage(0);
            return 0;
            break;
    }

    return DefWindowProc(hWnd, msg, wParam, lParam);
}
</code></pre>
<p>Ich verstehe einfach nicht, warum er Mucken macht bei LPVOID NULL einzusetzen. Das Template von DevC++ funktioniert ja auch mit NULL und lässt sich kompilieren.<br />
mfg olli</p>
]]></description><link>https://www.c-plusplus.net/forum/post/644048</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/644048</guid><dc:creator><![CDATA[Vertex]]></dc:creator><pubDate>Wed, 03 Nov 2004 21:02:54 GMT</pubDate></item><item><title><![CDATA[Reply to Prob bei CreateWindowEx on Wed, 03 Nov 2004 21:10:32 GMT]]></title><description><![CDATA[<p>Was und wo genau meckert er denn?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/644053</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/644053</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Wed, 03 Nov 2004 21:10:32 GMT</pubDate></item><item><title><![CDATA[Reply to Prob bei CreateWindowEx on Wed, 03 Nov 2004 21:32:09 GMT]]></title><description><![CDATA[<p>Vertex: Falsch. Er meckert wegen dem ersten Parameter. (Ex-Style)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/644067</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/644067</guid><dc:creator><![CDATA[00000]]></dc:creator><pubDate>Wed, 03 Nov 2004 21:32:09 GMT</pubDate></item><item><title><![CDATA[Reply to Prob bei CreateWindowEx on Wed, 03 Nov 2004 21:35:43 GMT]]></title><description><![CDATA[<p>Da wo &quot;// &lt;-- hier ist der Fehler&quot; steht <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>
<blockquote>
<p>C:\Programme\DevCpp\Projects\WinTest\main.cpp In function `int WinMain(HINSTANCE__<em>, HINSTANCE__</em>, CHAR*, int)':</p>
<p>57 C:\Programme\DevCpp\Projects\WinTest\main.cpp [Warning] passing NULL used for non-pointer argument passing 1 of ` HWND__* CreateWindowExA(long unsigned int, const CHAR*, const CHAR*, long</p>
<p>57 C:\Programme\DevCpp\Projects\WinTest\main.cpp [Warning] argument to non-pointer type `long unsigned int' from NULL</p>
</blockquote>
<p>möge verstehen wer will<br />
mfg olli</p>
<p>Edit: 00000: danke! Aber ist auch hier das selbe Problem <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/644072</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/644072</guid><dc:creator><![CDATA[Vertex]]></dc:creator><pubDate>Wed, 03 Nov 2004 21:35:43 GMT</pubDate></item><item><title><![CDATA[Reply to Prob bei CreateWindowEx on Wed, 03 Nov 2004 21:37:03 GMT]]></title><description><![CDATA[<p>Vertex: Wie das selbe Problem? Der Ex-Style ist kein Zeiger. Also sollte man dort 0 verwenden anstatt NULL. Kommt zwar aufs gleiche raus unter C++, aber das ist sauberer und die Warnung ist weg.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/644077</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/644077</guid><dc:creator><![CDATA[000000000]]></dc:creator><pubDate>Wed, 03 Nov 2004 21:37:03 GMT</pubDate></item><item><title><![CDATA[Reply to Prob bei CreateWindowEx on Wed, 03 Nov 2004 21:40:37 GMT]]></title><description><![CDATA[<p>mach ne 0 hin und gut ist.<br />
schau dir mal die windef.h an, wenn du ein c++ projekt müsste NULL == 0 und ein c projekt NULL == ((void*)0)</p>
<p>[edit]<br />
mal wieder zu langsam</p>
]]></description><link>https://www.c-plusplus.net/forum/post/644079</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/644079</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Wed, 03 Nov 2004 21:40:37 GMT</pubDate></item><item><title><![CDATA[Reply to Prob bei CreateWindowEx on Wed, 03 Nov 2004 21:40:18 GMT]]></title><description><![CDATA[<p>Ahh danke, ja in VisualC++ scheint da smit NULL zu gehen, aber hast recht 0 ist einleuchtend <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/644080</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/644080</guid><dc:creator><![CDATA[Vertex]]></dc:creator><pubDate>Wed, 03 Nov 2004 21:40:18 GMT</pubDate></item></channel></rss>