<?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[Fehlermeldung]]></title><description><![CDATA[<p>Also, wenn ich diesen Code kompiliere bekomme ich eine Fehlermeldung die ich nicht verstehe!</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

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

LPCSTR MainClassName = &quot;Eingabe vom Anwender&quot;;

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),
                     IDI_APPLICATION);
   wc.hCursor         = LoadCursor(NULL, IDC_CROSS);
   wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
   wc.lpszMenuName  = MainClassName;
   wc.lpszClassName = MainClassName;
   wc.hIconSm         = LoadIcon(GetModuleHandle(NULL),
                       IDI_APPLICATION);

   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;Gerätekontex Beispiel&quot;,
                          WS_SYSMENU|WS_VISIBLE,
                          CW_USEDEFAULT, CW_USEDEFAULT,
                          600, 480 ,NULL,NULL,hInstance, NULL);

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

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

LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg,
                          WPARAM wParam, LPARAM lParam )
{
  static POINT  ptCursor;
  static HDC    hDC;
  static char   szMsg[128];
  static char   szTmp[30];
  static int x, y;
  BYTE cBuf[256];
  RECT rc;

  switch( uMsg )
   {
      case WM_KEYDOWN :
           {
              GetKeyboardState(cBuf);
              if( cBuf[VK_SHIFT]&amp;0x80 &amp;&amp; cBuf[VK_CONTROL]&amp;0x80
                                      &amp;&amp; cBuf['A']&amp;0x80)
                   MessageBox(NULL, &quot;Sie haben die Tasten\n&quot;
                          &quot;[CONTOL]+[SHIFT]+[A] gleichzeitig\n&quot;
                              &quot;gedrückt&quot;,
                              &quot;[CONTROL] + [SHIFT] + [A]&quot;,
                              MB_ICONINFORMATION|MB_OK
                             |MB_DEFBUTTON1);
              else
              {
                SetRect(&amp;rc, 0, 0, 480, 20);
                InvalidateRect( hWnd, &amp;rc, TRUE );
                UpdateWindow( hWnd );
                hDC = GetDC( hWnd );
                GetKeyNameText( lParam, szTmp, 30 );
                wsprintf(szMsg, &quot;Taste \&quot;%s\&quot; betätigt&quot;,szTmp);
                TextOut( hDC, 10, 0, szMsg, lstrlen( szMsg ) );
                ReleaseDC( hWnd, hDC );
              }
           }
           break;
      case WM_KEYUP :
            switch( wParam )
               {
                int bAntwort;
                case VK_ESCAPE:
                bAntwort =
                 MessageBox(NULL,&quot;Sie haben \&quot;ESC\&quot; gedrückt!\n&quot;
                           &quot;Programm beenden?&quot;,&quot;Abfrage&quot;,
                           MB_ICONINFORMATION | MB_OKCANCEL |
                           MB_DEFBUTTON1);
                 if(bAntwort == IDOK)
                    PostQuitMessage(0);
                 else
                    break;
                }
           break;
      case WM_SYSCHAR :
           MessageBox(NULL, &quot;Sie haben einen ASCII-Code für\n&quot;
                      &quot;eine Buchstabentaste gedrückt,\n&quot;
                      &quot;während die [ALT]-Taste gedrückt war&quot;,
                      &quot;[ALT] + ASCII-Taste = WM_SYSCHAR&quot;,
                      MB_ICONINFORMATION | MB_OK |
                      MB_DEFBUTTON1);
           break;

      case WM_MOUSEMOVE :
              x = LOWORD(lParam);
              y = HIWORD(lParam);
              hDC = GetDC( hWnd );
              wsprintf( szMsg,&quot;Cursor X = %04d,Y = %04d&quot;,x, y );
              TextOut( hDC, 10, 30, szMsg, lstrlen( szMsg ) );
              ReleaseDC( hWnd, hDC );
              break;
     case WM_LBUTTONDOWN :
              x = LOWORD(lParam);
              y = HIWORD(lParam);
              hDC = GetDC( hWnd );
              wsprintf( szMsg,
              &quot;Linke Maustaste an Pos.: X = %04d, Y = %04d&quot;,x,y);
              TextOut( hDC, 10, 60, szMsg, lstrlen( szMsg ) );
              ReleaseDC( hWnd, hDC );
              break;
     case WM_RBUTTONDOWN :
              x = LOWORD(lParam);
              y = HIWORD(lParam);
              hDC = GetDC( hWnd );
              wsprintf( szMsg,
              &quot;Rechte Maustaste an Pos.: X = %04d, Y = %04d&quot;
                                                       ,x,y);
              TextOut( hDC, 10, 90, szMsg, lstrlen( szMsg ) );
              ReleaseDC( hWnd, hDC );
              break;
      case WM_DESTROY :
              PostQuitMessage(0);
              break;

      default :
            return(DefWindowProc( hWnd, uMsg, wParam, lParam ) );
   }

   return( 0L );
}
</code></pre>
<p>Fahlermeldung:</p>
<p>C:\Programme\Microsoft Visual Studio\MyProjects\shadow3\shadow3.cpp(9) : error C2065: 'uMsg' : nichtdeklarierter Bezeichner<br />
C:\Programme\Microsoft Visual Studio\MyProjects\shadow3\shadow3.cpp(13) : error C2065: 'wParam' : nichtdeklarierter Bezeichner<br />
Fehler beim Ausführen von cl.exe.</p>
<p>kann mir das bitte jemand erklären!</p>
<p>Mfg und Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/173477/fehlermeldung</link><generator>RSS for Node</generator><lastBuildDate>Fri, 18 Sep 2026 07:43:42 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/173477.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 16 Feb 2007 12:33:33 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fehlermeldung on Fri, 16 Feb 2007 12:33:33 GMT]]></title><description><![CDATA[<p>Also, wenn ich diesen Code kompiliere bekomme ich eine Fehlermeldung die ich nicht verstehe!</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;

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

LPCSTR MainClassName = &quot;Eingabe vom Anwender&quot;;

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),
                     IDI_APPLICATION);
   wc.hCursor         = LoadCursor(NULL, IDC_CROSS);
   wc.hbrBackground = (HBRUSH)(COLOR_WINDOW+1);
   wc.lpszMenuName  = MainClassName;
   wc.lpszClassName = MainClassName;
   wc.hIconSm         = LoadIcon(GetModuleHandle(NULL),
                       IDI_APPLICATION);

   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;Gerätekontex Beispiel&quot;,
                          WS_SYSMENU|WS_VISIBLE,
                          CW_USEDEFAULT, CW_USEDEFAULT,
                          600, 480 ,NULL,NULL,hInstance, NULL);

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

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

LRESULT CALLBACK WndProc( HWND hWnd, UINT uMsg,
                          WPARAM wParam, LPARAM lParam )
{
  static POINT  ptCursor;
  static HDC    hDC;
  static char   szMsg[128];
  static char   szTmp[30];
  static int x, y;
  BYTE cBuf[256];
  RECT rc;

  switch( uMsg )
   {
      case WM_KEYDOWN :
           {
              GetKeyboardState(cBuf);
              if( cBuf[VK_SHIFT]&amp;0x80 &amp;&amp; cBuf[VK_CONTROL]&amp;0x80
                                      &amp;&amp; cBuf['A']&amp;0x80)
                   MessageBox(NULL, &quot;Sie haben die Tasten\n&quot;
                          &quot;[CONTOL]+[SHIFT]+[A] gleichzeitig\n&quot;
                              &quot;gedrückt&quot;,
                              &quot;[CONTROL] + [SHIFT] + [A]&quot;,
                              MB_ICONINFORMATION|MB_OK
                             |MB_DEFBUTTON1);
              else
              {
                SetRect(&amp;rc, 0, 0, 480, 20);
                InvalidateRect( hWnd, &amp;rc, TRUE );
                UpdateWindow( hWnd );
                hDC = GetDC( hWnd );
                GetKeyNameText( lParam, szTmp, 30 );
                wsprintf(szMsg, &quot;Taste \&quot;%s\&quot; betätigt&quot;,szTmp);
                TextOut( hDC, 10, 0, szMsg, lstrlen( szMsg ) );
                ReleaseDC( hWnd, hDC );
              }
           }
           break;
      case WM_KEYUP :
            switch( wParam )
               {
                int bAntwort;
                case VK_ESCAPE:
                bAntwort =
                 MessageBox(NULL,&quot;Sie haben \&quot;ESC\&quot; gedrückt!\n&quot;
                           &quot;Programm beenden?&quot;,&quot;Abfrage&quot;,
                           MB_ICONINFORMATION | MB_OKCANCEL |
                           MB_DEFBUTTON1);
                 if(bAntwort == IDOK)
                    PostQuitMessage(0);
                 else
                    break;
                }
           break;
      case WM_SYSCHAR :
           MessageBox(NULL, &quot;Sie haben einen ASCII-Code für\n&quot;
                      &quot;eine Buchstabentaste gedrückt,\n&quot;
                      &quot;während die [ALT]-Taste gedrückt war&quot;,
                      &quot;[ALT] + ASCII-Taste = WM_SYSCHAR&quot;,
                      MB_ICONINFORMATION | MB_OK |
                      MB_DEFBUTTON1);
           break;

      case WM_MOUSEMOVE :
              x = LOWORD(lParam);
              y = HIWORD(lParam);
              hDC = GetDC( hWnd );
              wsprintf( szMsg,&quot;Cursor X = %04d,Y = %04d&quot;,x, y );
              TextOut( hDC, 10, 30, szMsg, lstrlen( szMsg ) );
              ReleaseDC( hWnd, hDC );
              break;
     case WM_LBUTTONDOWN :
              x = LOWORD(lParam);
              y = HIWORD(lParam);
              hDC = GetDC( hWnd );
              wsprintf( szMsg,
              &quot;Linke Maustaste an Pos.: X = %04d, Y = %04d&quot;,x,y);
              TextOut( hDC, 10, 60, szMsg, lstrlen( szMsg ) );
              ReleaseDC( hWnd, hDC );
              break;
     case WM_RBUTTONDOWN :
              x = LOWORD(lParam);
              y = HIWORD(lParam);
              hDC = GetDC( hWnd );
              wsprintf( szMsg,
              &quot;Rechte Maustaste an Pos.: X = %04d, Y = %04d&quot;
                                                       ,x,y);
              TextOut( hDC, 10, 90, szMsg, lstrlen( szMsg ) );
              ReleaseDC( hWnd, hDC );
              break;
      case WM_DESTROY :
              PostQuitMessage(0);
              break;

      default :
            return(DefWindowProc( hWnd, uMsg, wParam, lParam ) );
   }

   return( 0L );
}
</code></pre>
<p>Fahlermeldung:</p>
<p>C:\Programme\Microsoft Visual Studio\MyProjects\shadow3\shadow3.cpp(9) : error C2065: 'uMsg' : nichtdeklarierter Bezeichner<br />
C:\Programme\Microsoft Visual Studio\MyProjects\shadow3\shadow3.cpp(13) : error C2065: 'wParam' : nichtdeklarierter Bezeichner<br />
Fehler beim Ausführen von cl.exe.</p>
<p>kann mir das bitte jemand erklären!</p>
<p>Mfg und Danke</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1229517</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1229517</guid><dc:creator><![CDATA[Salomon_X]]></dc:creator><pubDate>Fri, 16 Feb 2007 12:33:33 GMT</pubDate></item><item><title><![CDATA[Reply to Fehlermeldung on Fri, 16 Feb 2007 12:40:58 GMT]]></title><description><![CDATA[<p>Was ist daran unverständlich? In den Zeilen 9 und 13 (~<strong>Auf welche Stellen im Quelltext verweist denn dein Compiler?</strong>~) werden Variablennamen verwendet, die an dieser Stelle nicht bekannt sind.</p>
<p>(was mir auffällt: Der switch-Block unter 'case WM_KEYUP:' sieht etwas deplaziert aus)</p>
<p>PS: versuch mal eine einheitliche Einrückung hinzubekommen, das erleichtert es Anderen, deinen Quelltext zu lesen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1229519</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1229519</guid><dc:creator><![CDATA[CStoll]]></dc:creator><pubDate>Fri, 16 Feb 2007 12:40:58 GMT</pubDate></item><item><title><![CDATA[Reply to Fehlermeldung on Fri, 16 Feb 2007 13:18:00 GMT]]></title><description><![CDATA[<p>Habe deinen Quelltext gerade kopiert und im DevStudio<br />
ein Projekt angelegt.</p>
<p>Kompiliert und funktioniert.</p>
<p>Prüfe mal deine Projekteinstellugen</p>
<p>Ich habe einfach ein leeres Win32 Projekt erzeugt, Quelltext<br />
kopiert. Fertig</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1229541</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1229541</guid><dc:creator><![CDATA[schokomann]]></dc:creator><pubDate>Fri, 16 Feb 2007 13:18:00 GMT</pubDate></item><item><title><![CDATA[Reply to Fehlermeldung on Fri, 16 Feb 2007 13:36:19 GMT]]></title><description><![CDATA[<p>Hab ich selbst auch schon bemerkt. Hab aus versehen ein Win-Konsolen Projekt erzeugt.</p>
<p>Aber trotzdem Danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1229561</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1229561</guid><dc:creator><![CDATA[Samlomon_X]]></dc:creator><pubDate>Fri, 16 Feb 2007 13:36:19 GMT</pubDate></item></channel></rss>