<?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[Linker-Fehler mit dev-cpp [was: frage]]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;resource.h&quot;

#define ID_TIMER 1

LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);

TCHAR szAppName[] = TEXT (&quot;MenuDemo&quot;);

int WINAPI WInMain (HINSTANCE hInstance , HINSTANCE hPrevInstance , PSTR szCmdLine, int iCmdShow)
{
    HWND hwnd;
    MSG msg;
    WNDCLASS wndclass;

    wndclass.style            = CS_HREDRAW | CS_VREDRAW;
    wndclass.lpfnWndProc      = WndProc;
    wndclass.cbClsExtra       = 0;
    wndclass.cbWndExtra       = 0;
    wndclass.hInstance        = hInstance;
    wndclass.hIcon            = LoadIcon(NULL, IDI_APPLICATION);
    wndclass.hCursor          = LoadCursor (NULL, IDC_ARROW);
    wndclass.hbrBackground    = (HBRUSH) GetStockObject (WHITE_BRUSH);      
    wndclass.lpszMenuName     = szAppName;
    wndclass.lpszClassName    = szAppName;

    hwnd = CreateWindow (szAppName, TEXT (&quot;Menu&quot;),
                            WS_OVERLAPPEDWINDOW,
                            CW_USEDEFAULT, CW_USEDEFAULT,
                            CW_USEDEFAULT, CW_USEDEFAULT,
                            NULL, NULL, hInstance, NULL);

    ShowWindow(hwnd, iCmdShow);
    UpdateWindow(hwnd);

    while (GetMessage (&amp;msg, NULL, 0, 0))
    {
        TranslateMessage(&amp;msg);
        DispatchMessage(&amp;msg);
    }
    return msg.wParam;
}

LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    static int idColor [5] = { WHITE_BRUSH, LTGRAY_BRUSH, GRAY_BRUSH, DKGRAY_BRUSH, BLACK_BRUSH };
    static int iSelection = IDM_BKGND_WHITE;
    HMENU hMenu;

    switch (message)
    {
        case WM_COMMAND:
            hMenu = GetMenu (hwnd);

            switch (LOWORD(wParam))   
            {
                case IDM_FILE_NEW:
                    case IDM_FILE_OPEN:
                    case IDM_FILE_SAVE:
                    case IDM_FILE_SAVE_AS:
                        MessageBeep(0);
                        return 0;
                    case IDM_APP_EXIT:
                        SendMessage (hwnd, WM_CLOSE, 0 ,0);
                        return 0;
                    case IDM_EDIT_UNDO:
                    case IDM_EDIT_CUT:
                    case IDM_EDIT_COPY:
                    case IDM_EDIT_PASTE:
                    case IDM_EDIT_CLEAR:
                        MessageBeep(0);
                        return 0;
                    case IDM_BKGND_WHITE:
                    case IDM_BKGND_LTGRAY:
                    case IDM_BKGND_GRAY:
                    case IDM_BKGND_DKGRAY:
                    case IDM_BKGND_BLACK:
                        CheckMenuItem(hMenu, iSelection, MF_UNCHECKED);
                        iSelection = LOWORD (wParam);
                        CheckMenuItem(hMenu, iSelection, MF_CHECKED); 

                        SetClassLong (hwnd, GCL_HBRBACKGROUND, (LONG)
                        GetStockObject (idColor [LOWORD (wParam) - IDM_BKGND_WHITE]));

                        InvalidateRect (hwnd, NULL, TRUE);
                        return 0;

                    case IDM_TIMER_START:
                        if (SetTimer (hwnd, ID_TIMER, 1000, NULL))
                        {
                            EnableMenuItem (hMenu, IDM_TIMER_START, MF_GRAYED);
                            EnableMenuItem (hMenu, IDM_TIMER_STOP, MF_ENABLED);
                        }
                        return 0;

                    case IDM_TIMER_STOP:
                        KillTimer (hwnd, ID_TIMER);
                        EnableMenuItem (hMenu, IDM_TIMER_START, MF_GRAYED);
                        EnableMenuItem (hMenu, IDM_TIMER_STOP, MF_ENABLED);
                        return 0;

                    case IDM_APP_HELP:
                        MessageBox (hwnd, TEXT (&quot;Hilfe noch nicht implementiert&quot;),
                        szAppName, MB_ICONEXCLAMATION | MB_OK);
                        return 0;

                    case IDM_APP_\1:
                        MessageBox (hwnd, TEXT (&quot;Menu\n&quot;)
                                          TEXT (&quot;(c) x,06&quot;),
                                          szAppName, MB_ICONINFORMATION | MB_OK);
                        return 0;
                }
                break;

                case WM_TIMER:
                    MessageBeep(0);
                    return 0;

                case WM_DESTROY:
                    PostQuitMessage(0);
                    return 0;
            }
            return DefWindowProc (hwnd, message, wParam, lParam);
        }
</code></pre>
<p>fehler:</p>
<p>[Linker error] undefined reference to <code>GetStockObject@4' \[Linker error\] undefined reference to</code>WinMain@16'</p>
<p>bitte nicht schieben schnell beantworten thx</p>
<p>[edit: bitte nächstes Mal einen aussagekräftigeren Titel verwenden]</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/135061/linker-fehler-mit-dev-cpp-was-frage</link><generator>RSS for Node</generator><lastBuildDate>Sun, 12 Jul 2026 01:43:58 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/135061.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 30 Jan 2006 14:11:34 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Mon, 30 Jan 2006 19:44:49 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;resource.h&quot;

#define ID_TIMER 1

LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);

TCHAR szAppName[] = TEXT (&quot;MenuDemo&quot;);

int WINAPI WInMain (HINSTANCE hInstance , HINSTANCE hPrevInstance , PSTR szCmdLine, int iCmdShow)
{
    HWND hwnd;
    MSG msg;
    WNDCLASS wndclass;

    wndclass.style            = CS_HREDRAW | CS_VREDRAW;
    wndclass.lpfnWndProc      = WndProc;
    wndclass.cbClsExtra       = 0;
    wndclass.cbWndExtra       = 0;
    wndclass.hInstance        = hInstance;
    wndclass.hIcon            = LoadIcon(NULL, IDI_APPLICATION);
    wndclass.hCursor          = LoadCursor (NULL, IDC_ARROW);
    wndclass.hbrBackground    = (HBRUSH) GetStockObject (WHITE_BRUSH);      
    wndclass.lpszMenuName     = szAppName;
    wndclass.lpszClassName    = szAppName;

    hwnd = CreateWindow (szAppName, TEXT (&quot;Menu&quot;),
                            WS_OVERLAPPEDWINDOW,
                            CW_USEDEFAULT, CW_USEDEFAULT,
                            CW_USEDEFAULT, CW_USEDEFAULT,
                            NULL, NULL, hInstance, NULL);

    ShowWindow(hwnd, iCmdShow);
    UpdateWindow(hwnd);

    while (GetMessage (&amp;msg, NULL, 0, 0))
    {
        TranslateMessage(&amp;msg);
        DispatchMessage(&amp;msg);
    }
    return msg.wParam;
}

LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    static int idColor [5] = { WHITE_BRUSH, LTGRAY_BRUSH, GRAY_BRUSH, DKGRAY_BRUSH, BLACK_BRUSH };
    static int iSelection = IDM_BKGND_WHITE;
    HMENU hMenu;

    switch (message)
    {
        case WM_COMMAND:
            hMenu = GetMenu (hwnd);

            switch (LOWORD(wParam))   
            {
                case IDM_FILE_NEW:
                    case IDM_FILE_OPEN:
                    case IDM_FILE_SAVE:
                    case IDM_FILE_SAVE_AS:
                        MessageBeep(0);
                        return 0;
                    case IDM_APP_EXIT:
                        SendMessage (hwnd, WM_CLOSE, 0 ,0);
                        return 0;
                    case IDM_EDIT_UNDO:
                    case IDM_EDIT_CUT:
                    case IDM_EDIT_COPY:
                    case IDM_EDIT_PASTE:
                    case IDM_EDIT_CLEAR:
                        MessageBeep(0);
                        return 0;
                    case IDM_BKGND_WHITE:
                    case IDM_BKGND_LTGRAY:
                    case IDM_BKGND_GRAY:
                    case IDM_BKGND_DKGRAY:
                    case IDM_BKGND_BLACK:
                        CheckMenuItem(hMenu, iSelection, MF_UNCHECKED);
                        iSelection = LOWORD (wParam);
                        CheckMenuItem(hMenu, iSelection, MF_CHECKED); 

                        SetClassLong (hwnd, GCL_HBRBACKGROUND, (LONG)
                        GetStockObject (idColor [LOWORD (wParam) - IDM_BKGND_WHITE]));

                        InvalidateRect (hwnd, NULL, TRUE);
                        return 0;

                    case IDM_TIMER_START:
                        if (SetTimer (hwnd, ID_TIMER, 1000, NULL))
                        {
                            EnableMenuItem (hMenu, IDM_TIMER_START, MF_GRAYED);
                            EnableMenuItem (hMenu, IDM_TIMER_STOP, MF_ENABLED);
                        }
                        return 0;

                    case IDM_TIMER_STOP:
                        KillTimer (hwnd, ID_TIMER);
                        EnableMenuItem (hMenu, IDM_TIMER_START, MF_GRAYED);
                        EnableMenuItem (hMenu, IDM_TIMER_STOP, MF_ENABLED);
                        return 0;

                    case IDM_APP_HELP:
                        MessageBox (hwnd, TEXT (&quot;Hilfe noch nicht implementiert&quot;),
                        szAppName, MB_ICONEXCLAMATION | MB_OK);
                        return 0;

                    case IDM_APP_\1:
                        MessageBox (hwnd, TEXT (&quot;Menu\n&quot;)
                                          TEXT (&quot;(c) x,06&quot;),
                                          szAppName, MB_ICONINFORMATION | MB_OK);
                        return 0;
                }
                break;

                case WM_TIMER:
                    MessageBeep(0);
                    return 0;

                case WM_DESTROY:
                    PostQuitMessage(0);
                    return 0;
            }
            return DefWindowProc (hwnd, message, wParam, lParam);
        }
</code></pre>
<p>fehler:</p>
<p>[Linker error] undefined reference to <code>GetStockObject@4' \[Linker error\] undefined reference to</code>WinMain@16'</p>
<p>bitte nicht schieben schnell beantworten thx</p>
<p>[edit: bitte nächstes Mal einen aussagekräftigeren Titel verwenden]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/981104</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/981104</guid><dc:creator><![CDATA[techmech]]></dc:creator><pubDate>Mon, 30 Jan 2006 19:44:49 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Mon, 30 Jan 2006 14:15:59 GMT]]></title><description><![CDATA[<p>Welche Entwicklungsumgebung?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/981109</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/981109</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Mon, 30 Jan 2006 14:15:59 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Mon, 30 Jan 2006 14:17:45 GMT]]></title><description><![CDATA[<p>windows/dev-cpp compiler <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/981111</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/981111</guid><dc:creator><![CDATA[techmech]]></dc:creator><pubDate>Mon, 30 Jan 2006 14:17:45 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Mon, 30 Jan 2006 14:58:17 GMT]]></title><description><![CDATA[<p>Schade, kann ich nix zu sagen... <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="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/981155</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/981155</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Mon, 30 Jan 2006 14:58:17 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Mon, 30 Jan 2006 15:00:51 GMT]]></title><description><![CDATA[<p>techmech schrieb:</p>
<blockquote>
<p>[Linker error] undefined reference to `GetStockObject@4'</p>
</blockquote>
<p>Gdi32-Bibliothek nicht dazugelinkt.</p>
<blockquote>
<p>[Linker error] undefined reference to `WinMain@16'</p>
</blockquote>
<p>Vermutlich falscher Projekttyp.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/981157</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/981157</guid><dc:creator><![CDATA[MFK]]></dc:creator><pubDate>Mon, 30 Jan 2006 15:00:51 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Mon, 30 Jan 2006 15:42:10 GMT]]></title><description><![CDATA[<p>Ich würde mal sagen, du hast nicht auf Win32-Fensteranwendung umgestellt, sondern Konsolenprogrammierung. Guck mal bei dir in den Eigenschaften deines Projektes und setz da mal Win32-Fensteranwendung/Windows so was ähnliches halt. Aber NICHT Konsole !<br />
Also MFK hat Recht mit:</p>
<p>MFK schrieb:</p>
<blockquote>
<p>Vermutlich falscher Projekttyp.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/981199</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/981199</guid><dc:creator><![CDATA[Compy]]></dc:creator><pubDate>Mon, 30 Jan 2006 15:42:10 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Mon, 30 Jan 2006 15:46:08 GMT]]></title><description><![CDATA[<p>jetzt ist es makewin</p>
<p>25 E:\Dev-Cpp\Makefile.win [Build Error] *** multiple target patterns. Stop.</p>
<p>er zeigt mir das dann in der makewin falsch an</p>
<p>ein kleines projekt wird schwerer und schwerer...</p>
<p>$(BIN): $(OBJ)</p>
<p>plz helft</p>
]]></description><link>https://www.c-plusplus.net/forum/post/981207</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/981207</guid><dc:creator><![CDATA[techmech]]></dc:creator><pubDate>Mon, 30 Jan 2006 15:46:08 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Mon, 30 Jan 2006 15:49:03 GMT]]></title><description><![CDATA[<p>jetzt ist es makewin</p>
<p>25 E:\Dev-Cpp\Makefile.win [Build Error] *** multiple target patterns. Stop.</p>
<p>er zeigt mir das dann in der makewin falsch an</p>
<p>ein kleines projekt wird schwerer und schwerer...</p>
<p>$(BIN): $(OBJ)</p>
<p>plz helft</p>
]]></description><link>https://www.c-plusplus.net/forum/post/981210</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/981210</guid><dc:creator><![CDATA[techmech]]></dc:creator><pubDate>Mon, 30 Jan 2006 15:49:03 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Mon, 30 Jan 2006 16:02:12 GMT]]></title><description><![CDATA[<p>ich habe jetzt auf win32 dll gestellt nun habe ich noch das mit dem stock gehabt habe die bibi eingefügt jetzt will er von mir eine host anwendung???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/981219</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/981219</guid><dc:creator><![CDATA[techmech]]></dc:creator><pubDate>Mon, 30 Jan 2006 16:02:12 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Mon, 30 Jan 2006 18:03:36 GMT]]></title><description><![CDATA[<p>arg... wie kann so viel mist in einem Thread stehen?</p>
<pre><code class="language-cpp">int WINAPI WinMain (HINSTANCE hInstance , HINSTANCE hPrevInstance , PSTR szCmdLine, int iCmdShow)
</code></pre>
<p>Jaja.. wie schreibt man WinMain? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> nicht WInMain...</p>
<p>und dann gibt es da noch sowas wie das MSDN und die haben ne Bilbiothek... s. <a href="http://www.msdn.microsoft.com/library/default.asp" rel="nofollow">http://www.msdn.microsoft.com/library/default.asp</a> ... so... da guck man mal nach GetStockObject... mal gucken welche Libs der sagt das man drin haben muss... und welche Header... <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/981418</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/981418</guid><dc:creator><![CDATA[*D*Evil]]></dc:creator><pubDate>Mon, 30 Jan 2006 18:03:36 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Mon, 30 Jan 2006 19:29:13 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">#include &lt;windows.h&gt;
#define IDM_FILE_NEW            40001
#define IDM_FILE_OPEN           40002 
#define IDM_FILE_SAVE           40003
#define IDM_FILE_SAVE_AS        40004
#define IDM_APP_EXIT            40005
#define IDM_EDIT_UNDO           40006
#define IDM_EDIT_CUT            40007
#define IDM_EDIT_COPY           40008
#define IDM_EDIT_PASTE          40009
#define IDM_EDIT_CLEAR          40010
#define IDM_BKGND_WHITE         40011
#define IDM_BKGND_LTGRAY        40012
#define IDM_BKGND_GRAY          40013
#define IDM_BKGND_DKGRAY        40014
#define IDM_BKGND_BLACK         40015
#define IDM_TIMER_START         40016
#define IDM_TIMER_STOP          40017
#define IDM_APP_HELP            40018
#define IDM_APP_ABOUT           40019

#define ID_TIMER 1

LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);

TCHAR szAppName[] = TEXT (&quot;MenuDemo&quot;);

int WINAPI WinMain (HINSTANCE hInstance , HINSTANCE hPrevInstance , PSTR szCmdLine, int iCmdShow)
{
    HWND hwnd;
    MSG msg;
    WNDCLASS wndclass;

    wndclass.style            = CS_HREDRAW | CS_VREDRAW;
    wndclass.lpfnWndProc      = WndProc;
    wndclass.cbClsExtra       = 0;
    wndclass.cbWndExtra       = 0;
    wndclass.hInstance        = hInstance;
    wndclass.hIcon            = LoadIcon(NULL, IDI_APPLICATION);
    wndclass.hCursor          = LoadCursor (NULL, IDC_ARROW);
    wndclass.hbrBackground    = (HBRUSH) GetStockObject (WHITE_BRUSH);      
    wndclass.lpszMenuName     = szAppName;
    wndclass.lpszClassName    = szAppName;

    hwnd = CreateWindow (szAppName, TEXT (&quot;Menu&quot;),
                            WS_OVERLAPPEDWINDOW,
                            CW_USEDEFAULT, CW_USEDEFAULT,
                            CW_USEDEFAULT, CW_USEDEFAULT,
                            NULL, NULL, hInstance, NULL);

    ShowWindow(hwnd, iCmdShow);
    UpdateWindow(hwnd);

    while (GetMessage (&amp;msg, NULL, 0, 0))
    {
        TranslateMessage(&amp;msg);
        DispatchMessage(&amp;msg);
    }
    return msg.wParam;
}

LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    static int idColor [5] = { WHITE_BRUSH, LTGRAY_BRUSH, GRAY_BRUSH, DKGRAY_BRUSH, BLACK_BRUSH };
    static int iSelection = IDM_BKGND_WHITE;
    HMENU hMenu;

    switch (message)
    {
        case WM_COMMAND:
            hMenu = GetMenu (hwnd);

        switch (LOWORD(wParam))   
        {
            case IDM_FILE_NEW:
            case IDM_FILE_OPEN:
            case IDM_FILE_SAVE:
            case IDM_FILE_SAVE_AS:
                MessageBeep(0);
                return 0;
            case IDM_APP_EXIT:
                SendMessage (hwnd, WM_CLOSE, 0 ,0);
                return 0;
            case IDM_EDIT_UNDO:
            case IDM_EDIT_CUT:
            case IDM_EDIT_COPY:
            case IDM_EDIT_PASTE:
            case IDM_EDIT_CLEAR:
                MessageBeep(0);
                return 0;
            case IDM_BKGND_WHITE:
            case IDM_BKGND_LTGRAY:
            case IDM_BKGND_GRAY:
            case IDM_BKGND_DKGRAY:
            case IDM_BKGND_BLACK:
                CheckMenuItem(hMenu, iSelection, MF_UNCHECKED);
                iSelection = LOWORD (wParam);
                CheckMenuItem(hMenu, iSelection, MF_CHECKED);

                SetClassLong (hwnd, GCL_HBRBACKGROUND, (LONG)
                GetStockObject (idColor [LOWORD (wParam) - IDM_BKGND_WHITE]));

                InvalidateRect (hwnd, NULL, TRUE);
                return 0;

            case IDM_TIMER_START:
                if (SetTimer (hwnd, ID_TIMER, 1000, NULL))
                {
                    EnableMenuItem (hMenu, IDM_TIMER_START, MF_GRAYED);
                    EnableMenuItem (hMenu, IDM_TIMER_STOP, MF_ENABLED);
                }
                return 0;

            case IDM_TIMER_STOP:
                KillTimer (hwnd, ID_TIMER);
                EnableMenuItem (hMenu, IDM_TIMER_START, MF_GRAYED);
                EnableMenuItem (hMenu, IDM_TIMER_STOP, MF_ENABLED);
                return 0;

            case IDM_APP_HELP:
                MessageBox (hwnd, TEXT (&quot;Hilfe noch nicht implementiert&quot;),
                szAppName, MB_ICONEXCLAMATION | MB_OK);
                return 0;

            case IDM_APP_\1:
                MessageBox (hwnd, TEXT (&quot;Menu\n&quot;)
                                  TEXT (&quot;(c) x,06&quot;),
                                  szAppName, MB_ICONINFORMATION | MB_OK);
                return 0;
        }
        break;

        case WM_TIMER:
            MessageBeep(0);
            return 0;

        case WM_DESTROY:
            PostQuitMessage(0);
            return 0;
    }
    return DefWindowProc (hwnd, message, wParam, lParam);
}
</code></pre>
<p>so ich habe das schöne ding ma wieder kompiliert und nun kann ichs auch kompilieren er zeigt aber rein garnix an</p>
]]></description><link>https://www.c-plusplus.net/forum/post/981474</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/981474</guid><dc:creator><![CDATA[techmech]]></dc:creator><pubDate>Mon, 30 Jan 2006 19:29:13 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Tue, 31 Jan 2006 11:02:11 GMT]]></title><description><![CDATA[<p>Du hast da oben definiert:</p>
<pre><code class="language-cpp">TCHAR szAppName[] = &quot;...&quot;;
</code></pre>
<p>Versuch's mal mit</p>
<pre><code class="language-cpp">const char szAppName[] = &quot;...&quot;;
</code></pre>
<p>Wenn das Prog nämlich die richtige Definition des Namens nicht findet, verweigert es Dir die Registrierung der Fensterklasse.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/981852</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/981852</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Tue, 31 Jan 2006 11:02:11 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Tue, 31 Jan 2006 20:29:10 GMT]]></title><description><![CDATA[<p>kk habe ich jetzt gemacht aber nun sagt er erstellt er mir einen prozess bei den optionen</p>
<p>win32gui, konsole, statische dll</p>
<p>und bei win32dll sagt er ich muss eine host anwendung konfigurieren unter ausführen menü parameter</p>
]]></description><link>https://www.c-plusplus.net/forum/post/982512</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/982512</guid><dc:creator><![CDATA[techmech]]></dc:creator><pubDate>Tue, 31 Jan 2006 20:29:10 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Tue, 31 Jan 2006 22:00:17 GMT]]></title><description><![CDATA[<blockquote>
<p>Wenn das Prog nämlich die richtige Definition des Namens nicht findet, verweigert es Dir die Registrierung der Fensterklasse.</p>
</blockquote>
<p>Und noch besser funktioniert die Registrierung einer Fensterklasse, wenn man sie vor<br />
CreateWindow()<br />
mit<br />
RegisterClass()<br />
registriert <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/982589</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/982589</guid><dc:creator><![CDATA[Walter Z]]></dc:creator><pubDate>Tue, 31 Jan 2006 22:00:17 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Wed, 01 Feb 2006 08:15:34 GMT]]></title><description><![CDATA[<p>Jou, da hadder Recht. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /><br />
Nicht aufgeben, gemeinsam schaffen wir das! <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/982737</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/982737</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Wed, 01 Feb 2006 08:15:34 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Wed, 01 Feb 2006 12:47:16 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">if (!RegisterClass (&amp;wndclass))
    {
        MessageBox(NULL,TEXT(&quot;Programm basiert auf UNICODE!&quot;), szAppName, MB_ICONERROR);
        return 0;
    }
</code></pre>
<p>das habe ich noch hinzugefügt und habe nun die einstellungen win32gui bernutzt jetzt öffnet er ein standart weißes windows fenster...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/982951</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/982951</guid><dc:creator><![CDATA[techmech]]></dc:creator><pubDate>Wed, 01 Feb 2006 12:47:16 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Wed, 01 Feb 2006 16:02:50 GMT]]></title><description><![CDATA[<p>techmech schrieb:</p>
<blockquote>
<p>das habe ich noch hinzugefügt und habe nun die einstellungen win32gui bernutzt jetzt öffnet er ein stan**** weißes windows fenster...</p>
</blockquote>
<p>Na, das ist doch was.<br />
Warte mal, aus Deinem Programm entnehme ich, daß Du irgendwo auf ein Menü zugreifen willst, das aber nicht erscheint. Du hast bei</p>
<pre><code class="language-cpp">&quot;wc.lpszMenuName&quot; = szAppName
</code></pre>
<p>, keinen Menünamen und keinen Resourcenverweis (LoadMenu(...)) eingegeben. Es fehlt also der Hinweis auf die Resource.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/983204</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/983204</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Wed, 01 Feb 2006 16:02:50 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Wed, 01 Feb 2006 18:33:25 GMT]]></title><description><![CDATA[<p>wie würde das aussehen ich habe da keine peilung?</p>
<p>und sind rc dateien wichtig?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/983377</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/983377</guid><dc:creator><![CDATA[techmech]]></dc:creator><pubDate>Wed, 01 Feb 2006 18:33:25 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Thu, 02 Feb 2006 10:17:43 GMT]]></title><description><![CDATA[<p>rc-Dateien sind unerläßlich, weil Du darin dem Programm sagst, wie Dein Menü aussehen soll, und mit welchen IDs es angesprochen wird. Die Definition der IDs werden dann noch in einer Header-Datei (meistens &quot;resource.h&quot;) eingebunden.<br />
Bei mir sieht das so aus:</p>
<pre><code class="language-cpp">//rc-Datei
#include &quot;resource.h&quot;
IDM_MENU1 MENU DISCARDABLE
{
 POPUP &quot;&amp;Datei&quot;
 {
  MENUITEM &quot;&amp;Öffnen&quot;, 102
  MENUITEM &quot;&amp;Speichern&quot;, 103
  MENUITEM SEPARATOR
  MENUITEM &quot;&amp;Beenden&quot;, 108
 }

 POPUP &quot;&amp;Hilfe&quot;
 {
  MENUITEM &quot;&amp;Über&quot;, 903
 }

}

STRINGTABLE 
{
 102, &quot;Datei öffnen&quot;
 103, &quot;Datei Speichern&quot;
 108, &quot;Programm Beenden&quot;
 903, &quot;Infos zum Programm&quot;
}
</code></pre>
<p>Anmerkung: Mein Prog habe ich mit Borland Resource-Workshop erstellt, daher die Klammern. Du mußt die öffnenden Klammern mit BEGIN und die schließenden mit END ersetzen.<br />
Diese rc-Datei wird mit dem Resourcen-Kompiler (meistens RC.EXE) in eine res-Datei (Binärformat) umgewandelt und beim Linken zum Hauptcode gebunden.</p>
<p>Hier die dazu gehörige Header (was Du schon im Hauptprogramm gemacht hast):</p>
<pre><code class="language-cpp">//resource.h
#define IDM_MENU1 1
#define IDS_STRING_OPEN	102
#define IDS_STRING_SAVE	103
#define IDS_STRING_EXIT	108
#define IDS_STRING_ABOUT	903

#define IDM_FILE_OPEN 102
#define IDM_FILE_SAVE 103
#define IDM_FILE_EXIT 108
#define IDM_HELP_ABOUT 903
</code></pre>
<p>und eingebunden wird das ganze im Hauptprogramm mit</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;resource.h&quot;
//Die &quot; &quot; stehen dafür, daß die .h-Datei in deinem Projekt-Verzeichnis liegt, nicht im Kompiler-Verzeichnis.
(...)

WNDCLASSEX wc;
(...)
wc.lpszMenuName   = MAKEINTRESOURCE(IDM_MENU1);
(...)
RegisterClassEx (&amp;wc) //usw...
</code></pre>
<p>Theoretisch könnte man das alles auch im Hauptprogramm machen, aber dann müßtest Du für jedes neue Projekt das Menü neu zusammenbauen. So hast Du für jedes neue Projekt schon die Grundlagen und brauchst sie nur noch entsprechend zu ändern.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/983756</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/983756</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Thu, 02 Feb 2006 10:17:43 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Thu, 02 Feb 2006 11:18:09 GMT]]></title><description><![CDATA[<p>aha , jetzt sehe ich das aus ner anderen perspektive. ich habe das programm dem petzold entnommen aber in den rc dateien gibt es noch den include &quot;afxres.h&quot;<br />
was soll das sein???</p>
]]></description><link>https://www.c-plusplus.net/forum/post/983818</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/983818</guid><dc:creator><![CDATA[techmech]]></dc:creator><pubDate>Thu, 02 Feb 2006 11:18:09 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Thu, 02 Feb 2006 11:42:10 GMT]]></title><description><![CDATA[<p>nach meiner meinung ist das jetzt richtig:</p>
<p>Menudemo.cpp:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;resource.h&quot;

#define ID_TIMER 1

LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);

const char szAppName[] = &quot;...&quot;;

int WINAPI WinMain (HINSTANCE hInstance , HINSTANCE hPrevInstance , PSTR szCmdLine, int iCmdShow)
{
    HWND hwnd;
    MSG msg;
    WNDCLASS wndclass;

    wndclass.style            = CS_HREDRAW | CS_VREDRAW;
    wndclass.lpfnWndProc      = WndProc;
    wndclass.cbClsExtra       = 0;
    wndclass.cbWndExtra       = 0;
    wndclass.hInstance        = hInstance;
    wndclass.hIcon            = LoadIcon(NULL, IDI_APPLICATION);
    wndclass.hCursor          = LoadCursor (NULL, IDC_ARROW);
    wndclass.hbrBackground    = (HBRUSH) GetStockObject (WHITE_BRUSH);      
    wndclass.lpszMenuName     = szAppName;
    wndclass.lpszClassName    = szAppName;

    if (!RegisterClass (&amp;wndclass))
    {
        MessageBox(NULL,TEXT(&quot;Programm basiert auf UNICODE!&quot;), szAppName, MB_ICONERROR);
        return 0;
    }    

    hwnd = CreateWindow (szAppName, TEXT (&quot;Menu&quot;),
                            WS_OVERLAPPEDWINDOW,
                            CW_USEDEFAULT, CW_USEDEFAULT,
                            CW_USEDEFAULT, CW_USEDEFAULT,
                            NULL, NULL, hInstance, NULL);

    ShowWindow(hwnd, iCmdShow);
    UpdateWindow(hwnd);

    while (GetMessage (&amp;msg, NULL, 0, 0))
    {
        TranslateMessage(&amp;msg);
        DispatchMessage(&amp;msg);
    }
    return msg.wParam;
}

LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
{
    static int idColor [5] = { WHITE_BRUSH, LTGRAY_BRUSH, GRAY_BRUSH, DKGRAY_BRUSH, BLACK_BRUSH };
    static int iSelection = IDM_BKGND_WHITE;
    HMENU hMenu;

    switch (message)
    {
        case WM_COMMAND:
            hMenu = GetMenu (hwnd);

        switch (LOWORD(wParam))   
        {
            case IDM_FILE_NEW:
            case IDM_FILE_OPEN:
            case IDM_FILE_SAVE:
            case IDM_FILE_SAVE_AS:
                MessageBeep(0);
                return 0;
            case IDM_APP_EXIT:
                SendMessage (hwnd, WM_CLOSE, 0 ,0);
                return 0;
            case IDM_EDIT_UNDO:
            case IDM_EDIT_CUT:
            case IDM_EDIT_COPY:
            case IDM_EDIT_PASTE:
            case IDM_EDIT_CLEAR:
                MessageBeep(0);
                return 0;
            case IDM_BKGND_WHITE:
            case IDM_BKGND_LTGRAY:
            case IDM_BKGND_GRAY:
            case IDM_BKGND_DKGRAY:
            case IDM_BKGND_BLACK:
                CheckMenuItem(hMenu, iSelection, MF_UNCHECKED);
                iSelection = LOWORD (wParam);
                CheckMenuItem(hMenu, iSelection, MF_CHECKED);

                SetClassLong (hwnd, GCL_HBRBACKGROUND, (LONG)
                GetStockObject (idColor [LOWORD (wParam) - IDM_BKGND_WHITE]));

                InvalidateRect (hwnd, NULL, TRUE);
                return 0;

            case IDM_TIMER_START:
                if (SetTimer (hwnd, ID_TIMER, 1000, NULL))
                {
                    EnableMenuItem (hMenu, IDM_TIMER_START, MF_GRAYED);
                    EnableMenuItem (hMenu, IDM_TIMER_STOP, MF_ENABLED);
                }
                return 0;

            case IDM_TIMER_STOP:
                KillTimer (hwnd, ID_TIMER);
                EnableMenuItem (hMenu, IDM_TIMER_START, MF_GRAYED);
                EnableMenuItem (hMenu, IDM_TIMER_STOP, MF_ENABLED);
                return 0;

            case IDM_APP_HELP:
                MessageBox (hwnd, TEXT (&quot;Hilfe noch nicht implementiert&quot;),
                szAppName, MB_ICONEXCLAMATION | MB_OK);
                return 0;

            case IDM_APP_\1:
                MessageBox (hwnd, TEXT (&quot;Menu\n&quot;)
                                  TEXT (&quot;(c) x,06&quot;),
                                  szAppName, MB_ICONINFORMATION | MB_OK);
                return 0;
        }
        break;

        case WM_TIMER:
            MessageBeep(0);
            return 0;

        case WM_DESTROY:
            PostQuitMessage(0);
            return 0;
    }
    return DefWindowProc (hwnd, message, wParam, lParam);
}
</code></pre>
<p>Menudemo.rc:</p>
<pre><code class="language-cpp">#include &quot;resource.h&quot;
#include &quot;afxres.h&quot;

MENUDEMO MENU DISCARDABLE
BEGIN
POPUP &quot;&amp;Datei&quot;
BEGIN
MENUITEM &quot;&amp;Neu&quot;,                IDM_FILE_NEW
MENUITEM &quot;&amp;Öffnen&quot;,             IDM_FILE_OPEN
MENUITEM &quot;&amp;Speichern&quot;,          IDM_FILE_SAVE
MENUITEM &quot;Speichern &amp;unter&quot;,    IDM_FILE_SAVE_AS     
MENUITEM &quot;B&amp;eenden&quot;,            IDM_APP_EXIT
END
POPUP &quot;&amp;Bearbeiten&quot;
BEGIN
MENUITEM &quot;&amp;Widerrufen&quot;,         IDM_EDIT_UNDO
MENUITEM &quot;A&amp;usschneiden&quot;,       IDM_EDIT_CUT
MENUITEM &quot;&amp;Kopieren&quot;,           IDM_EDIT_COPY
MENUITEM &quot;&amp;Einfügen&quot;,           IDM_EDIT_PASTE
MENUITEM &quot;&amp;Löschen&quot;,            IDM_EDIT_CLEAR
END
POPUP &quot;&amp;Hintergrund&quot;
BEGIN
MENUITEM &quot;&amp;Weiß&quot;,               IDM_BKGND_WHITE, CHECKED
MENUITEM &quot;&amp;Hellgrau&quot;,           IDM_BKGND_LTGRAY
MENUITEM &quot;&amp;Grau&quot;,               IDM_BKGND_GRAY
MENUITEM &quot;&amp;Dunkelgrau&quot;,         IDM_BKGND_DKGRAY
MENUITEM &quot;&amp;Schwarz&quot;,            IDM_BKGND_BLACK
END
POPUP &quot;&amp;Timer&quot;
BEGIN
MENUITEM &quot;&amp;Start&quot;,              IDM_TIMER_START
MENUITEM &quot;S&amp;top&quot;,               IDM_TIMER_STOP, GRAYED
END
POPUP &quot;&amp;Hilfe&quot;
BEGIN
MENUITEM &quot;&amp;Hilfe...&quot;,               IDM_APP_HELP
MENUITEM &quot;I&amp;nfo über MenuDemo...&quot;,  IDM_APP_ABOUT
END
END
</code></pre>
<p>resource.h:</p>
<pre><code class="language-cpp">#define IDM_FILE_NEW            40001
#define IDM_FILE_OPEN           40002 
#define IDM_FILE_SAVE           40003
#define IDM_FILE_SAVE_AS        40004
#define IDM_APP_EXIT            40005
#define IDM_EDIT_UNDO           40006
#define IDM_EDIT_CUT            40007
#define IDM_EDIT_COPY           40008
#define IDM_EDIT_PASTE          40009
#define IDM_EDIT_CLEAR          40010
#define IDM_BKGND_WHITE         40011
#define IDM_BKGND_LTGRAY        40012
#define IDM_BKGND_GRAY          40013
#define IDM_BKGND_DKGRAY        40014
#define IDM_BKGND_BLACK         40015
#define IDM_TIMER_START         40016
#define IDM_TIMER_STOP          40017
#define IDM_APP_HELP            40018
#define IDM_APP_ABOUT           40019
</code></pre>
<p>aber trotzdem will er mir die menüpunkte nicht anzeigen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/983833</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/983833</guid><dc:creator><![CDATA[techmech]]></dc:creator><pubDate>Thu, 02 Feb 2006 11:42:10 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Thu, 02 Feb 2006 13:15:40 GMT]]></title><description><![CDATA[<p>Das Menü wurde sehr wahrscheinlich ncht geladen, füge nach dem CreateWindow() noch einen LoadMenu()-Aufruf ein. Hoffentlich hilft dies.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/983896</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/983896</guid><dc:creator><![CDATA[Win32-API]]></dc:creator><pubDate>Thu, 02 Feb 2006 13:15:40 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Thu, 02 Feb 2006 13:23:29 GMT]]></title><description><![CDATA[<p>GetMenu (hwnd);<br />
und<br />
LoadMenu(hInstance,szCmdLine)</p>
<p>funzen net</p>
]]></description><link>https://www.c-plusplus.net/forum/post/983909</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/983909</guid><dc:creator><![CDATA[techmech]]></dc:creator><pubDate>Thu, 02 Feb 2006 13:23:29 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Thu, 02 Feb 2006 13:29:23 GMT]]></title><description><![CDATA[<p>Hallo, Techmech</p>
<p>Du hast bei &quot;Wndclass.lpszMenuName&quot; immer noch &quot;szAppName&quot; stehen. szAppName ist kein Menü. Da muß MAKEINTRESOURCE() stehen (siehe mein Code oben im letztn Posting).</p>
]]></description><link>https://www.c-plusplus.net/forum/post/983918</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/983918</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Thu, 02 Feb 2006 13:29:23 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Thu, 02 Feb 2006 13:37:07 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">WNDCLASSEX wc;

    wndclass.style            = CS_HREDRAW | CS_VREDRAW;
    wndclass.lpfnWndProc      = WndProc;
    wndclass.cbClsExtra       = 0;
    wndclass.cbWndExtra       = 0;
    wndclass.hInstance        = hInstance;
    wndclass.hIcon            = LoadIcon(NULL, IDI_APPLICATION);
    wndclass.hCursor          = LoadCursor (NULL, IDC_ARROW);
    wndclass.hbrBackground    = (HBRUSH) GetStockObject (WHITE_BRUSH);      
    wc.lpszMenuName           = MAKEINTRESOURCE(IDM_MENU1);
    wndclass.lpszClassName    = szAppName;

    RegisterClassEx (&amp;wc);
</code></pre>
<p>`IDM_MENU' undeclared (first use this function)<br />
[Build Error] [Menudemo.o] Error 1</p>
<p>-.-</p>
<p>übrigens ich hbae das gefühl das meine .rc datei nicht benutzt wird. kann man die spezifisch einlinken?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/983935</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/983935</guid><dc:creator><![CDATA[techmech]]></dc:creator><pubDate>Thu, 02 Feb 2006 13:37:07 GMT</pubDate></item><item><title><![CDATA[Reply to Linker-Fehler mit dev-cpp [was: frage] on Thu, 02 Feb 2006 15:58:46 GMT]]></title><description><![CDATA[<p>Ist doch klar:</p>
<p>In der .rc-Datei hast Du dein Menü mit</p>
<pre><code class="language-cpp">MENUDEMO MENU DISCARDABLE
</code></pre>
<p>&quot;MENUDEMO&quot; benannt, versuchst hier aber mit</p>
<pre><code class="language-cpp">wc.lpszMenuName           = MAKEINTRESOURCE(IDM_MENU1);
</code></pre>
<p>ein Menü namens &quot;IDM_MENU1&quot; einzbinden (vermutlich hast Du die Zeile einfach aus meinem Posting kopiert, ohne sie zu verstehen <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f609.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--winking_face"
      title=";)"
      alt="😉"
    /> ).<br />
Außerdem fehlt in Deiner resource.h die Definition des IDs des Menüs. Vorschlag dafür:</p>
<pre><code class="language-cpp">#define MENUDEMO 1
</code></pre>
<p>(in der obersten Zeile einfügen).</p>
<p>Mir scheint, Du hast einige Verständnisprobleme (ist keine Schande <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f576.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--sunglasses"
      title=":sunglasses:"
      alt="🕶"
    /> ):</p>
<p>Schau Dir Deine letzten Postings noch mal an. Um 12:42 hieß Deine WNDCLASSEX noch &quot;wndclass&quot;, um 14:37 heißt sie &quot;wc&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>
<pre><code class="language-cpp">WNDCLASSEX wc;//wc oder wndclass???

    wndclass.style            = CS_HREDRAW | CS_VREDRAW;
    wndclass.lpfnWndProc      = WndProc;
    wndclass.cbClsExtra       = 0;
    wndclass.cbWndExtra       = 0;
    wndclass.hInstance        = hInstance;
    wndclass.hIcon            = LoadIcon(NULL, IDI_APPLICATION);
    wndclass.hCursor          = LoadCursor (NULL, IDC_ARROW);
    wndclass.hbrBackground    = (HBRUSH) GetStockObject (WHITE_BRUSH);    
//**********************  
    wc.lpszMenuName           = MAKEINTRESOURCE(IDM_MENU1);//wc oder wndclass???
//**********************
    wndclass.lpszClassName    = szAppName;

    RegisterClassEx (&amp;wc);//wc oder wndclass???
</code></pre>
<p>Dir sollte aufgefallen sein, daß bei API-Programmen alle VarialbenTYPEN mit Großbuchstaben geschrieben werden (UINT, HINSTANCE, WPARAM, LPARAM) die Benennung der Variablen aber klein bzw. gemischt (msg, hInstance, wParam). Das gilt aber nur für den cpp-Code, nicht für die Resourcenscripts und die IDs. In diesem Fall gibt es nur ungeschriebene Gesetze, Konventionen.</p>
<p>Also zum Verständnis: msg ist der Name einer Variable vom Typ UINT.</p>
<p>WNDCLASSEX ist eine Datensturktur (eigentlich eine mehrdimensionale Variable), in der die Fensterparameter festgelegt werden. &quot;wc&quot; oder &quot;wndclass&quot; ist der Name des Fensters, das aus diesen Daten aus der WNDCLASSEX-Struktur aufgebaut wird. Die Struktur kann also unter verschiedenen Namen mehrfach belegt werden. Der Name kann willkürlich gewählt werden (außer &quot;WNDCLASSEX&quot;), muß aber bei allen Parametern für jeweils ein Fenster gleich sein!</p>
<p>Die rc-Datei kann man nicht spezifisch einlinken, sondern nur die .res-Datei (Resourcen-Datei im Binärformat, wird aus der rc-Datei kompiliert). Wenn Du eine integrierte Entwicklungsumgebung benutzt, sollte diese das Einbinden der .res selbständig vornehmen (evtl. mußt Du sie in einer Projektdatei angeben, das kann ich aber aus der Ferne nicht sagen). Bei einem Kommandozeilenkompiler mußt Du die .res-Datei als Kommandozeilenparameter angeben.</p>
<p>Übrigens hast Du nach einer &quot;afxres.h&quot; gefragt. Kenne ich nicht, wofür soll die sein?</p>
<p>So, das wars erstmal für heute.<br />
Viel Erfolg.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/984114</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/984114</guid><dc:creator><![CDATA[Elektronix]]></dc:creator><pubDate>Thu, 02 Feb 2006 15:58:46 GMT</pubDate></item></channel></rss>