<?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[Dialog bringt Programm zum abstürzen]]></title><description><![CDATA[<p>hi,<br />
diesmal hab ich ein Problem mit Dialogen und hoffe wiedermal auf eure Hilfe.<br />
Ich hab ein Programm 100% aus einem Buch abgeschrieben ab es funktioniert nicht, das heißt wenn ich auf den Menüeintrag klicke nachdem der Dialog aufgerufen werden soll ist mein fenster nach noch nicht einer Sekunde weg.<br />
Es handelt sich dabei um ein älteres Buch daher hoffe ich das trotzdem jemand den Fehler findet. Der Debugger &quot;sagt&quot; das irgendwas mit</p>
<pre><code class="language-cpp">DialogBox(((LPCREATESTRUCT)lParam)-&gt;hInstance, TEXT(&quot;IDD_ABOUTBOX&quot;),hWnd,AboutDlgProc);
</code></pre>
<p>nicht stimmt. die Resourcen Datei sieht so aus:</p>
<pre><code class="language-cpp">IDD_ABOUTBOX DIALOG   22, 17, 230, 75
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION &quot;Info&quot;
FONT 8, &quot;System&quot;
BEGIN
    ICON            IDI_FIRSTDIALOG,IDC_MYICON,14,9,16,16
    LTEXT           &quot;FirstDialog, Version 1.0&quot;,IDC_STATIC,49,10,119,8,SS_NOPREFIX
    LTEXT           &quot;Copyright (C) 2007&quot;,IDC_STATIC,49,20,119,8
    DEFPUSHBUTTON   &quot;OK&quot;,IDOK,195,6,30,11,WS_GROUP
END
</code></pre>
<p>und resource.h:</p>
<pre><code class="language-cpp">#define IDS_APP_TITLE			103

#define IDR_MAINFRAME			128
#define IDD_FIRSTDIALOG_DIALOG	102
#define IDD_ABOUTBOX			103
#define IDM_ABOUT				104
#define IDM_EXIT				105
#define IDI_FIRSTDIALOG			107
#define IDI_SMALL				108
#define IDC_FIRSTDIALOG			109
#define IDC_MYICON				2
#ifndef IDC_STATIC
#define IDC_STATIC				-1
#endif
// Nächste Standardwerte für neue Objekte
// 
#define IDM_APP_ABOUT 40001
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS

#define _APS_NO_MFC					130
#define _APS_NEXT_RESOURCE_VALUE	129
#define _APS_NEXT_COMMAND_VALUE		32771
#define _APS_NEXT_CONTROL_VALUE		1000
#define _APS_NEXT_SYMED_VALUE		110
#endif
#endif[cpp]
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/183205/dialog-bringt-programm-zum-abstürzen</link><generator>RSS for Node</generator><lastBuildDate>Tue, 07 Jul 2026 05:06:54 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/183205.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 02 Jun 2007 18:24:39 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dialog bringt Programm zum abstürzen on Sat, 02 Jun 2007 18:24:39 GMT]]></title><description><![CDATA[<p>hi,<br />
diesmal hab ich ein Problem mit Dialogen und hoffe wiedermal auf eure Hilfe.<br />
Ich hab ein Programm 100% aus einem Buch abgeschrieben ab es funktioniert nicht, das heißt wenn ich auf den Menüeintrag klicke nachdem der Dialog aufgerufen werden soll ist mein fenster nach noch nicht einer Sekunde weg.<br />
Es handelt sich dabei um ein älteres Buch daher hoffe ich das trotzdem jemand den Fehler findet. Der Debugger &quot;sagt&quot; das irgendwas mit</p>
<pre><code class="language-cpp">DialogBox(((LPCREATESTRUCT)lParam)-&gt;hInstance, TEXT(&quot;IDD_ABOUTBOX&quot;),hWnd,AboutDlgProc);
</code></pre>
<p>nicht stimmt. die Resourcen Datei sieht so aus:</p>
<pre><code class="language-cpp">IDD_ABOUTBOX DIALOG   22, 17, 230, 75
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION &quot;Info&quot;
FONT 8, &quot;System&quot;
BEGIN
    ICON            IDI_FIRSTDIALOG,IDC_MYICON,14,9,16,16
    LTEXT           &quot;FirstDialog, Version 1.0&quot;,IDC_STATIC,49,10,119,8,SS_NOPREFIX
    LTEXT           &quot;Copyright (C) 2007&quot;,IDC_STATIC,49,20,119,8
    DEFPUSHBUTTON   &quot;OK&quot;,IDOK,195,6,30,11,WS_GROUP
END
</code></pre>
<p>und resource.h:</p>
<pre><code class="language-cpp">#define IDS_APP_TITLE			103

#define IDR_MAINFRAME			128
#define IDD_FIRSTDIALOG_DIALOG	102
#define IDD_ABOUTBOX			103
#define IDM_ABOUT				104
#define IDM_EXIT				105
#define IDI_FIRSTDIALOG			107
#define IDI_SMALL				108
#define IDC_FIRSTDIALOG			109
#define IDC_MYICON				2
#ifndef IDC_STATIC
#define IDC_STATIC				-1
#endif
// Nächste Standardwerte für neue Objekte
// 
#define IDM_APP_ABOUT 40001
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS

#define _APS_NO_MFC					130
#define _APS_NEXT_RESOURCE_VALUE	129
#define _APS_NEXT_COMMAND_VALUE		32771
#define _APS_NEXT_CONTROL_VALUE		1000
#define _APS_NEXT_SYMED_VALUE		110
#endif
#endif[cpp]
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1297304</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297304</guid><dc:creator><![CDATA[noha_391]]></dc:creator><pubDate>Sat, 02 Jun 2007 18:24:39 GMT</pubDate></item><item><title><![CDATA[Reply to Dialog bringt Programm zum abstürzen on Sat, 02 Jun 2007 18:33:57 GMT]]></title><description><![CDATA[<p>Hi,</p>
<p>diese Zeile:</p>
<pre><code class="language-cpp">DialogBox(((LPCREATESTRUCT)lParam)-&gt;hInstance, TEXT(&quot;IDD_ABOUTBOX&quot;),hWnd,AboutDlgProc);
</code></pre>
<p>kann auch nur unter <em>WM_CREATE</em> funktionieren, da nur da im lParam ein Zeiger auf ein <em>CREATESTRUCT</em> abgelegt ist.<br />
Des weiteren schreib mal lieber:</p>
<pre><code class="language-cpp">DialogBox(GetModuleHandle(NULL), MAKEINTRESOURCE(IDD_ABOUTBOX),hWnd,AboutDlgProc);
</code></pre>
<p>(Letzteres sollte Dein Problem beheben <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="😉"
    /> .)</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297315</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297315</guid><dc:creator><![CDATA[CodeFinder]]></dc:creator><pubDate>Sat, 02 Jun 2007 18:33:57 GMT</pubDate></item><item><title><![CDATA[Reply to Dialog bringt Programm zum abstürzen on Sat, 02 Jun 2007 18:44:27 GMT]]></title><description><![CDATA[<p>Vielen Dank das Problem ist gelöst.<br />
Der fehler liegt auch nicht im Buch, dort steht</p>
<pre><code class="language-cpp">DialogBox(((LPCREATESTRUCT)lParam)-&gt;hInstance, TEXT(&quot;IDD_ABOUTBOX&quot;),hWnd,AboutDlgProc);
</code></pre>
<p>Aber da beschwert sich der Kompiler deshalb hab ich mal (ohne mir große Gedanken zu machen einfach was &quot;ähnliches&quot; was auch WM_CREATE funktionierte reinzusetzen</p>
<p>mfG noha</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1297323</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1297323</guid><dc:creator><![CDATA[noha_391]]></dc:creator><pubDate>Sat, 02 Jun 2007 18:44:27 GMT</pubDate></item></channel></rss>