<?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[Problem mit Exe(oder so)]]></title><description><![CDATA[<p>moin zusammen,</p>
<p>ich habe hier ein kleines Problem mit meinen Exe-Dateien.<br />
Also das compilern läuft ohne Probleme, keine einziger Fehlerund auch keine Warnung.<br />
Wenn ich die Exe jedoch starte, dann wird sie zwar in den Speicher geladen, ich bekomme aber nichts zu sehen. Sie läuft praktisch im Hintergrund.<br />
Könnte das vielleicht daran liegen, dass mein Compiler das ganze als Konsolen Anwendung ansieht, und es falsch kompilert?<br />
Glaub ich eher nicht, da ich das Projekt als Win32-Anwendung erstellt habe.<br />
Hier mal mein Code:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;resource.h&quot;

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

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    PSTR szCmdLine, int iCmdShow)
{
     static TCHAR szAppName[] = &quot;Menu-Demo&quot; ;
     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  = &quot;MENUDEMO&quot; ;
     wndclass.lpszClassName = &quot;MENUDEMO&quot; ;

     if (!RegisterClass (&amp;wndclass)) return 0;

      hwnd = CreateWindow (szAppName,                 // Name der Fensterklasse
                  &quot;Menu-Demo&quot;,                        // Fenstertitel
                  WS_OVERLAPPEDWINDOW,                // Fensterstil
                  CW_USEDEFAULT,                      // X-Position des Fensters
                  CW_USEDEFAULT,                      // Y-Position des Fensters
                  CW_USEDEFAULT,                      // Fensterbreite
                  CW_USEDEFAULT,                      // Fensterhöhe
                  NULL,                               // übergeordnetes Fenster
                  NULL,                               // Menü
                  hInstance,                          // Programm-Kopiezähler (Programm-ID)
                  NULL) ;                             // zusätzliche Parameter

     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)
{
     HDC         hdc ;

     switch (message)
     {

     case WM_DESTROY:
          PostQuitMessage (0) ;
          return 0 ;
     }
     return DefWindowProc (hwnd, message, wParam, lParam) ;
}
</code></pre>
<p>Weiß jemand von euch Rat?<br />
Hatt jemand das gleiche Problem?</p>
<p>PS: Das Programm soll lediglich ein Menü anzeigen!</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/110750/problem-mit-exe-oder-so</link><generator>RSS for Node</generator><lastBuildDate>Tue, 30 Jun 2026 23:11:23 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/110750.rss" rel="self" type="application/rss+xml"/><pubDate>Tue, 24 May 2005 10:04:28 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit Exe(oder so) on Tue, 24 May 2005 10:04:28 GMT]]></title><description><![CDATA[<p>moin zusammen,</p>
<p>ich habe hier ein kleines Problem mit meinen Exe-Dateien.<br />
Also das compilern läuft ohne Probleme, keine einziger Fehlerund auch keine Warnung.<br />
Wenn ich die Exe jedoch starte, dann wird sie zwar in den Speicher geladen, ich bekomme aber nichts zu sehen. Sie läuft praktisch im Hintergrund.<br />
Könnte das vielleicht daran liegen, dass mein Compiler das ganze als Konsolen Anwendung ansieht, und es falsch kompilert?<br />
Glaub ich eher nicht, da ich das Projekt als Win32-Anwendung erstellt habe.<br />
Hier mal mein Code:</p>
<pre><code class="language-cpp">#include &lt;windows.h&gt;
#include &quot;resource.h&quot;

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

int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
                    PSTR szCmdLine, int iCmdShow)
{
     static TCHAR szAppName[] = &quot;Menu-Demo&quot; ;
     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  = &quot;MENUDEMO&quot; ;
     wndclass.lpszClassName = &quot;MENUDEMO&quot; ;

     if (!RegisterClass (&amp;wndclass)) return 0;

      hwnd = CreateWindow (szAppName,                 // Name der Fensterklasse
                  &quot;Menu-Demo&quot;,                        // Fenstertitel
                  WS_OVERLAPPEDWINDOW,                // Fensterstil
                  CW_USEDEFAULT,                      // X-Position des Fensters
                  CW_USEDEFAULT,                      // Y-Position des Fensters
                  CW_USEDEFAULT,                      // Fensterbreite
                  CW_USEDEFAULT,                      // Fensterhöhe
                  NULL,                               // übergeordnetes Fenster
                  NULL,                               // Menü
                  hInstance,                          // Programm-Kopiezähler (Programm-ID)
                  NULL) ;                             // zusätzliche Parameter

     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)
{
     HDC         hdc ;

     switch (message)
     {

     case WM_DESTROY:
          PostQuitMessage (0) ;
          return 0 ;
     }
     return DefWindowProc (hwnd, message, wParam, lParam) ;
}
</code></pre>
<p>Weiß jemand von euch Rat?<br />
Hatt jemand das gleiche Problem?</p>
<p>PS: Das Programm soll lediglich ein Menü anzeigen!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/794850</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/794850</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 24 May 2005 10:04:28 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Exe(oder so) on Tue, 24 May 2005 10:12:36 GMT]]></title><description><![CDATA[<p>die registrierte fensterklasse muss gleich sein<br />
[cpp]<br />
// ..<br />
wndclass.lpszClassName = <strong>szAppName</strong> ;<br />
// ..<br />
hwnd = CreateWindow (<strong>szAppName</strong>, // Name der Fensterklasse<br />
// ..<br />
[/cpp]</p>
]]></description><link>https://www.c-plusplus.net/forum/post/794857</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/794857</guid><dc:creator><![CDATA[miller_m]]></dc:creator><pubDate>Tue, 24 May 2005 10:12:36 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Exe(oder so) on Tue, 24 May 2005 10:26:00 GMT]]></title><description><![CDATA[<p>stimmt, das wars.<br />
Danke für die schnelle Antwort!!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/794867</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/794867</guid><dc:creator><![CDATA[[[global:guest]]]]></dc:creator><pubDate>Tue, 24 May 2005 10:26:00 GMT</pubDate></item></channel></rss>