<?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[Ressource Datei geht nicht]]></title><description><![CDATA[<p>Hi!<br />
Also ich bin jetzt ganz neu bei WinApi und hänge gerade am Fenstermenü fest...<br />
also hab halt meine cpp datei, fürs Fenster und dann die ressource.h und dann meine menu.rc ...<br />
in meiner menu.rc hab ich folgendes geschrieben:</p>
<pre><code>#include &lt;windows.h&gt;
#include &quot;resource.h&quot;

/////////////////////////////////////////////////////////////////
//
// Menü
//

IDR_MENU1 MENU
BEGIN
    POPUP &quot;Datei&quot;
    BEGIN
        MENUITEM &quot;Öffnen&quot; ,        ID_FILE_OPEN
    END
    POPUP &quot;Optionen&quot;
    BEGIN
        POPUP &quot;Optionen&quot;
        BEGIN
            MENUITEM &quot;Option1&quot;,    IP_FILE_OPTION1
        END
    END
END
</code></pre>
<p>Hab dann noch die Datei zum Projekt hinzugefügt und wollte compilen, aber dann kam der Fehler, dass in Zeile 13 ein Syntaxfehler wäre...in meinem Tut steht, der Syntax ist &quot;Ressource Namen, Idenfikationsnummer&quot;...in meinen Augen passt das da oben also, aber woran liegts?<br />
Weiß jemand Rat?</p>
<p>PS: Kann mir noch jemand erklären, warum beim ersten Menüpunkt nur POPUP &quot;Datei&quot; geschrieben werden muss und bei jedem weiteren Menüpunkt</p>
<pre><code>POPUP &quot;Optionen&quot;
BEGIN
    POPUP &quot;Optionen&quot;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/243815/ressource-datei-geht-nicht</link><generator>RSS for Node</generator><lastBuildDate>Sat, 04 Apr 2026 01:54:29 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/243815.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 21 Jun 2009 18:22:55 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Ressource Datei geht nicht on Sun, 21 Jun 2009 18:22:55 GMT]]></title><description><![CDATA[<p>Hi!<br />
Also ich bin jetzt ganz neu bei WinApi und hänge gerade am Fenstermenü fest...<br />
also hab halt meine cpp datei, fürs Fenster und dann die ressource.h und dann meine menu.rc ...<br />
in meiner menu.rc hab ich folgendes geschrieben:</p>
<pre><code>#include &lt;windows.h&gt;
#include &quot;resource.h&quot;

/////////////////////////////////////////////////////////////////
//
// Menü
//

IDR_MENU1 MENU
BEGIN
    POPUP &quot;Datei&quot;
    BEGIN
        MENUITEM &quot;Öffnen&quot; ,        ID_FILE_OPEN
    END
    POPUP &quot;Optionen&quot;
    BEGIN
        POPUP &quot;Optionen&quot;
        BEGIN
            MENUITEM &quot;Option1&quot;,    IP_FILE_OPTION1
        END
    END
END
</code></pre>
<p>Hab dann noch die Datei zum Projekt hinzugefügt und wollte compilen, aber dann kam der Fehler, dass in Zeile 13 ein Syntaxfehler wäre...in meinem Tut steht, der Syntax ist &quot;Ressource Namen, Idenfikationsnummer&quot;...in meinen Augen passt das da oben also, aber woran liegts?<br />
Weiß jemand Rat?</p>
<p>PS: Kann mir noch jemand erklären, warum beim ersten Menüpunkt nur POPUP &quot;Datei&quot; geschrieben werden muss und bei jedem weiteren Menüpunkt</p>
<pre><code>POPUP &quot;Optionen&quot;
BEGIN
    POPUP &quot;Optionen&quot;
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1730665</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1730665</guid><dc:creator><![CDATA[Finn]]></dc:creator><pubDate>Sun, 21 Jun 2009 18:22:55 GMT</pubDate></item><item><title><![CDATA[Reply to Ressource Datei geht nicht on Sun, 21 Jun 2009 18:26:18 GMT]]></title><description><![CDATA[<p>Ah hat sich erledigt...kommt im übernächsten Kapitel vom tutorial <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":P"
      alt="😛"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1730669</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1730669</guid><dc:creator><![CDATA[Finn]]></dc:creator><pubDate>Sun, 21 Jun 2009 18:26:18 GMT</pubDate></item><item><title><![CDATA[Reply to Ressource Datei geht nicht on Sun, 21 Jun 2009 18:39:11 GMT]]></title><description><![CDATA[<p>Hm...den obigen Fehler konnt ich jetzt durchs tutorial beseitigen, aber iregendwie klappts trotzdem nicht...<br />
hier mal meine Dateien:<br />
main.cpp:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;resource.h&quot;

LPCSTR MainClassName = &quot;Ein Menü-Beispiel&quot;;

LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg,
                         WPARAM wParam, LPARAM lParam);

int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance,
                   PSTR szCmdLine, int iCmdShow)
{
    WNDCLASSEX wc;
    MSG wmsg;
    HWND hWnd;

    wc.cbSize           = sizeof(WNDCLASSEX);
    wc.style            = 0;
    wc.lpfnWndProc      = WndProc;
    wc.cbClsExtra       = 0;
    wc.cbWndExtra       = 0;
    wc.hInstance        = hInstance;
    wc.hIcon            = LoadIcon(GetModuleHandle(NULL), MAKEINTRESOURCE(ID_ICON));
    wc.hCursor          = LoadCursor(NULL, IDC_ARROW);
    wc.hbrBackground    = (HBRUSH)(COLOR_WINDOW+1);
    wc.lpszMenuName     = MAKEINTRESOURCE(IDR_MENU1);
    wc.lpszClassName    = MainClassName;
    wc.hIconSm          = (HICON)LoadImage(GetModuleHandle(NULL),
                                        MAKEINTRESOURCE(ID_ICON),
                                        IMAGE_ICON, 16, 16, 0);

    if(!RegisterClassEx(&amp;wc))
    {
        MessageBox(NULL, &quot;Windows Registrations Fehler&quot;, &quot;Error!&quot;,
                   MB_ICONEXCLAMATION | MB_OK);
        return 0;
    }

    hWnd = CreateWindowEx(WS_EX_CLIENTEDGE, MainClassName,
                          &quot;Menü Beispiel&quot;,
                          WS_OVERLAPPEDWINDOW | WS_VISIBLE,
                          CW_USEDEFAULT, CW_USEDEFAULT,
                          300, 150, NULL, NULL, hInstance, NULL);

    if(hWnd == NULL)
    {
          MessageBox(NULL, &quot;Fehler beim Erstellen des Fensters!&quot;,
                           &quot;Error!&quot;, MB_ICONEXCLAMATION | MB_OK);
          return 0;
    }

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

LRESULT CALLBACK WndProc(HWND hWnd, UINT iMsg,
                         WPARAM wParam, LPARAM lParam)
{
    char string[255];

    switch (iMsg)
    {
        case WM_CLOSE:
            DestroyWindow(hWnd);
            break;
        case WM_DESTROY:
            PostQuitMessage(0);
            return 0;
        case WM_COMMAND:
            switch(LOWORD(wParam))
            {
                case ID_FILE_OPEN:
                    LoadString(GetModuleHandle(NULL), ID_STRING_OPEN,
                               string, sizeof(string));
                    MessageBox(hWnd, string, &quot;Öffnen&quot;, MB_ICONINFORMATION);
                    break;
                case ID_FILE_SAVE:
                    LoadString(GetModuleHandle(NULL), ID_STRING_SAVE,
                               string, sizeof(string));
                    MessageBox(hWnd, string, &quot;Speichern&quot;, MB_ICONINFORMATION);
                    break;
                case ID_OPTIONS_OPTIONS_OPTION1:
                    LoadString(GetModuleHandle(NULL), ID_STRING_OPTION1,
                               string, sizeof(string));
                    MessageBox(hWnd, string, &quot;Option 1&quot;, MB_ICONINFORMATION);
                    break;
                case ID_OPTIONS_OPTIONS_OPTION2:
                    LoadString(GetModuleHandle(NULL), ID_STRING_OPTION2,
                               string, sizeof(string));
                    MessageBox(hWnd, string, &quot;Option 2&quot;, MB_ICONINFORMATION);
                    break;
                case ID_\1:
                    LoadString(GetModuleHandle(NULL), ID_STRING_ABOUT,
                               string, sizeof(string));
                    MessageBox(hWnd, string, &quot;Über&quot;, MB_ICONINFORMATION);
                    break;
                case ID_FILE_EXIT:
                    DestroyWindow(hWnd);
                    break;
            }
            break;
    }
    return DefWindowProc(hWnd, iMsg, wParam, lParam);
}
</code></pre>
<p>resource.h:</p>
<pre><code class="language-cpp">//resource.h - Headerdatei

#define ID_STRING_OPEN                  1
#define ID_STRING_SAVE                  2
#define ID_STRING_OPTION1               3
#define ID_STRING_OPTION2               4
#define ID_STRING_ABOUT                 5

#define IDR_MENU1                       101

#define ID_ICON                         111

#define ID_FILE_OPEN                    40001
#define ID_FILE_SAVE                    40002
#define ID_FILE_EXIT                    40003
#define ID_OPTIONS_OPTIONS_OPTION1      40004
#define ID_OPTIONS_OPTIONS_OPTION2      40005
#define ID_ABOUT                        65535
</code></pre>
<p>menu.rc:</p>
<pre><code class="language-cpp">//main.rc - Ressourcen-Skriptdatei

#include &lt;windows.h&gt;
#include &quot;resource.h&quot;

/////////////////////////////////////////////////////////////////
//
// Menü
//
IDR_MENU1 MENU
BEGIN
    POPUP &quot;Datei&quot;
    BEGIN
        MENUITEM &quot;Öffnen&quot;,             ID_FILE_OPEN
        MENUITEM &quot;Speichern&quot;,          ID_FILE_SAVE
        MENUITEM &quot;Ende&quot;,               ID_FILE_EXIT
    END
    POPUP &quot;Optionen&quot;
    BEGIN
        POPUP &quot;Optionen&quot;
        BEGIN
            MENUITEM &quot;Option&amp;1&quot;,       ID_OPTIONS_OPTIONS_OPTION1
            MENUITEM &quot;Option&amp;2&quot;,       ID_OPTIONS_OPTIONS_OPTION2
        END
    END
    MENUITEM &quot;Über&quot;,                   ID_ABOUT
END

/////////////////////////////////////////////////////////////////
//
// Icon
//
//Sollte Sie dieses oder ein anderes Icon zur Verfügung haben,
//entfernen Sie bitte die Auskommentierung.
//
//ID_ICON              ICON        &quot;goofy.ico&quot;

/////////////////////////////////////////////////////////////////
//
// Stringtabelle
//
STRINGTABLE
BEGIN
        ID_STRING_OPEN,      &quot;Der Dialog Öffnen&quot;
        ID_STRING_SAVE,      &quot;Der Dialog Speichern&quot;
        ID_STRING_OPTION1,   &quot;Erste Option im Untermenü&quot;
        ID_STRING_OPTION2,   &quot;Zweite Option im Untermenü&quot;
        ID_STRING_ABOUT,     &quot;Ein Menü-Beispiel\nCoded by J.Wolf&quot;
END
</code></pre>
<p>Weil meine net funktioniert haben, hab ich mal genau die ausm tutorial genommen...alle 3 dateien sind zum Projekt hinzugefügt!<br />
Aber wenn ich jetzt compile kommt folgender fehler:<br />
resource.rc Zeile 12: Syntax Error!</p>
<p>aber resource.rc hab ich ja garnit geschrieben <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="😕"
    /><br />
Oder erzeugts die automatisch? Bzw. muss ich die selber noch verändern?<br />
Hier der Code der resource.rc:</p>
<pre><code class="language-cpp">#include &quot;resource.h&quot;

DLG_MAIN DIALOGEX 6, 5, 194, 106

CAPTION &quot;Code::Blocks Template Dialog App&quot;

FONT 8, &quot;MS Sans Serif&quot;, 0, 0, 1

STYLE 0x10CE0804

BEGIN
  CONTROL &quot;&amp;Test&quot;, IDC_BTN_TEST, &quot;Button&quot;, 0x10010000, 138,  5, 46, 15
  CONTROL &quot;&amp;Quit&quot;, IDC_BTN_QUIT, &quot;Button&quot;, 0x10010000, 138, 29, 46, 15
END
</code></pre>
<p>Hoffe ihr könnts mir erklären !</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1730677</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1730677</guid><dc:creator><![CDATA[Finn]]></dc:creator><pubDate>Sun, 21 Jun 2009 18:39:11 GMT</pubDate></item><item><title><![CDATA[Reply to Ressource Datei geht nicht on Mon, 22 Jun 2009 11:37:36 GMT]]></title><description><![CDATA[<p>Weiß keiner Rat? <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/1730940</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1730940</guid><dc:creator><![CDATA[Finn]]></dc:creator><pubDate>Mon, 22 Jun 2009 11:37:36 GMT</pubDate></item><item><title><![CDATA[Reply to Ressource Datei geht nicht on Tue, 23 Jun 2009 10:55:37 GMT]]></title><description><![CDATA[<p>Naja hat sich von selbst gelöst...lag am Compiler...hatte Code::Blocks und bin jetzt aber auf dev umgestiegen und da gings dann auf einmal <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61b.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_tongue"
      title=":P"
      alt="😛"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1731515</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1731515</guid><dc:creator><![CDATA[Finn]]></dc:creator><pubDate>Tue, 23 Jun 2009 10:55:37 GMT</pubDate></item><item><title><![CDATA[Reply to Ressource Datei geht nicht on Tue, 23 Jun 2009 11:55:50 GMT]]></title><description><![CDATA[<p>Warum zurück auf eine veralterte und nicht mehr zeitgemäße IDE?<br />
Probier doch einfach mal die Express Edition von Visual Studio. Umsonst und meiner Meinung nach weitaus besser geeignet für WinAPI-Entwicklung.<br />
Näheres nebst Installationsanleitung: <a href="http://www.c-plusplus.net/forum/viewtopic-var-t-is-143003.html" rel="nofollow">http://www.c-plusplus.net/forum/viewtopic-var-t-is-143003.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1731549</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1731549</guid><dc:creator><![CDATA[mad_martin]]></dc:creator><pubDate>Tue, 23 Jun 2009 11:55:50 GMT</pubDate></item></channel></rss>