<?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[Dialogbox-Problem]]></title><description><![CDATA[<p>Ich habe mir eine Dialogbox gebaut. Den szFileName bekomme auch normal.<br />
Aber aus irgeneinem Grund bleibt der titlename leer. Weiß jemand warum?<br />
Danke im Vorraus</p>
<pre><code class="language-cpp">void OpenFileBox(HWND hwnd,PTSTR titlename)
{
   OPENFILENAME ofn;
   szFileName[0] = '\0';
   titlename[0]  = '\0';

   ZeroMemory(&amp;ofn, sizeof(ofn));

   ofn.lStructSize = sizeof(ofn);
   ofn.hwndOwner = hwnd;
   ofn.lpstrFilter = &quot;HTML Datei (*.html)\0*.html\0&quot;
                     &quot;Text Datei (*.txt)\0*.txt\0&quot;
                     &quot;Alle Dateien (*.*)\0*.*\0&quot;;
   ofn.lpstrFile = szFileName;
   ofn.nMaxFile = MAX_PATH;
   ofn.Flags = OFN_HIDEREADONLY|OFN_CREATEPROMPT;
   ofn.lpstrDefExt = &quot;txt&quot;;
   ofn.lpstrFileTitle=titlename;

   if(GetOpenFileName(&amp;ofn))
      {
         MessageBox(hwnd,titlename,&quot;&quot;,MB_OK);  //Hier Sollter der Title ausgegeben werden
         HWND hEdit = GetDlgItem(hwnd, IDC_MAIN_EDIT);
         if(LoadText(hEdit, szFileName))
            {
               SendDlgItemMessage(hwnd, IDC_MAIN_STATUS,
                              SB_SETTEXT, 0, (LPARAM)&quot;Geöffnet...&quot;);
            }
      }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/topic/116843/dialogbox-problem</link><generator>RSS for Node</generator><lastBuildDate>Fri, 03 Jul 2026 06:40:32 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/116843.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 31 Jul 2005 17:53:02 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Dialogbox-Problem on Sun, 31 Jul 2005 17:53:02 GMT]]></title><description><![CDATA[<p>Ich habe mir eine Dialogbox gebaut. Den szFileName bekomme auch normal.<br />
Aber aus irgeneinem Grund bleibt der titlename leer. Weiß jemand warum?<br />
Danke im Vorraus</p>
<pre><code class="language-cpp">void OpenFileBox(HWND hwnd,PTSTR titlename)
{
   OPENFILENAME ofn;
   szFileName[0] = '\0';
   titlename[0]  = '\0';

   ZeroMemory(&amp;ofn, sizeof(ofn));

   ofn.lStructSize = sizeof(ofn);
   ofn.hwndOwner = hwnd;
   ofn.lpstrFilter = &quot;HTML Datei (*.html)\0*.html\0&quot;
                     &quot;Text Datei (*.txt)\0*.txt\0&quot;
                     &quot;Alle Dateien (*.*)\0*.*\0&quot;;
   ofn.lpstrFile = szFileName;
   ofn.nMaxFile = MAX_PATH;
   ofn.Flags = OFN_HIDEREADONLY|OFN_CREATEPROMPT;
   ofn.lpstrDefExt = &quot;txt&quot;;
   ofn.lpstrFileTitle=titlename;

   if(GetOpenFileName(&amp;ofn))
      {
         MessageBox(hwnd,titlename,&quot;&quot;,MB_OK);  //Hier Sollter der Title ausgegeben werden
         HWND hEdit = GetDlgItem(hwnd, IDC_MAIN_EDIT);
         if(LoadText(hEdit, szFileName))
            {
               SendDlgItemMessage(hwnd, IDC_MAIN_STATUS,
                              SB_SETTEXT, 0, (LPARAM)&quot;Geöffnet...&quot;);
            }
      }
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/842897</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842897</guid><dc:creator><![CDATA[Ask]]></dc:creator><pubDate>Sun, 31 Jul 2005 17:53:02 GMT</pubDate></item><item><title><![CDATA[Reply to Dialogbox-Problem on Sun, 31 Jul 2005 18:00:58 GMT]]></title><description><![CDATA[<p>Woher kommt eigentlich szFileName?! Und sind szFileName und titlename gültige BUffer, die auch groß genug sind?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/842902</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842902</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Sun, 31 Jul 2005 18:00:58 GMT</pubDate></item><item><title><![CDATA[Reply to Dialogbox-Problem on Sun, 31 Jul 2005 18:05:05 GMT]]></title><description><![CDATA[<p>szFileName ist ein char[MAX_PATH] und titlename ist wie man oben sieht eine PTSTR.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/842909</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842909</guid><dc:creator><![CDATA[Ask]]></dc:creator><pubDate>Sun, 31 Jul 2005 18:05:05 GMT</pubDate></item><item><title><![CDATA[Reply to Dialogbox-Problem on Sun, 31 Jul 2005 18:17:13 GMT]]></title><description><![CDATA[<p>hallo<br />
setz doch zu testzwecken am beginn deines snipsels<br />
szFileName und titlename gleich.<br />
das sollte möglich sein, wenn ich mich recht erinnere, und schau was dein code<br />
dann macht.</p>
<p>mfg f.-th.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/842928</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842928</guid><dc:creator><![CDATA[f.-th.]]></dc:creator><pubDate>Sun, 31 Jul 2005 18:17:13 GMT</pubDate></item><item><title><![CDATA[Reply to Dialogbox-Problem on Sun, 31 Jul 2005 18:46:12 GMT]]></title><description><![CDATA[<p>Hab ich gemacht. Es geht immer noch nicht. -<br />
Die Variable die hinter ofn.lpstrFile ist gefüllt während die, die hinter andere ofn.lpstrFileTitle steht leer ist.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/842958</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/842958</guid><dc:creator><![CDATA[Ask]]></dc:creator><pubDate>Sun, 31 Jul 2005 18:46:12 GMT</pubDate></item><item><title><![CDATA[Reply to Dialogbox-Problem on Mon, 01 Aug 2005 00:54:58 GMT]]></title><description><![CDATA[<p>Mit ofn.nMaxFileTitle kannst/musst du angeben, wieviele Zeichen maximal, einschließlich der abschließenden '\0', in den ofn.lpstrFileTitle-Puffer kopiert werden dürfen. Mit anderen Worten, wie groß der Puffer ist, auf den ofn.lpstrFileTitle zeigt. Der Wert ist in deinem Beispiel scheint's 0.</p>
<p>Walter</p>
]]></description><link>https://www.c-plusplus.net/forum/post/843095</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/843095</guid><dc:creator><![CDATA[Walter Z]]></dc:creator><pubDate>Mon, 01 Aug 2005 00:54:58 GMT</pubDate></item><item><title><![CDATA[Reply to Dialogbox-Problem on Mon, 01 Aug 2005 09:12:30 GMT]]></title><description><![CDATA[<p>Jetzt geht es vielen dank.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/843237</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/843237</guid><dc:creator><![CDATA[Ask]]></dc:creator><pubDate>Mon, 01 Aug 2005 09:12:30 GMT</pubDate></item></channel></rss>