<?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 ComboBox]]></title><description><![CDATA[<p>Ich habe folgendes Problem mit einer ComboBox wenn ich was in einer Combox verändere ruft er das hier auf:</p>
<pre><code class="language-cpp">void CHalfLifeSerialEditDlg::OnSelchangeComboLang() 
{
    CString m_ksa;
    m_ComboLang.GetLBText(m_ComboLang.GetCurSel(), m_ksa);  

    if (m_ksa == &quot;Deutsch&quot;)
    {

        GetDlgItem(IDC_STATIC_OPTIONEN)-&gt;SetWindowText(optionenar[0]);
        GetDlgItem(IDOK)-&gt;SetWindowText(savear[0]);
        GetDlgItem(IDCANCEL)-&gt;SetWindowText(exitar[0]);

    }
    else if (m_ksa == &quot;Englisch&quot;)
    {
        GetDlgItem(IDC_STATIC_OPTIONEN)-&gt;SetWindowText(optionenar[1]);
        GetDlgItem(IDOK)-&gt;SetWindowText(savear[1]);
        GetDlgItem(IDCANCEL)-&gt;SetWindowText(exitar[1]);
    }

    SaveKey(HKEY_LOCAL_MACHINE,&quot;SOFTWARE\\MysticSoft\\HLSE&quot;,&quot;Sprache&quot;,m_ksa);
}
</code></pre>
<p>DAs lauft auch ganz super.</p>
<p>Aber wenn ich am Programm start das auf rufe:</p>
<pre><code class="language-cpp">CString lang = ReadKey(HKEY_LOCAL_MACHINE,&quot;SOFTWARE\\MysticSoft\\HLSE&quot;,&quot;Sprache&quot;);

    if (lang == &quot;Deutsch&quot;)
    {
        m_ComboLang.SetCurSel(m_ComboLang.FindString(-1,&quot;Deutsch&quot;));
    }
    else if (lang == &quot;Englisch&quot;)
    {
        m_ComboLang.SetCurSel(m_ComboLang.FindString(-1,&quot;Englisch&quot;));
    }
    else
    {
        m_ComboLang.SetCurSel(m_ComboLang.FindString(-1,&quot;Deutsch&quot;));
    }

    OnSelchangeComboLang();
</code></pre>
<p>Giebt es eine absturtz. Das liegt an der zeile:</p>
<pre><code class="language-cpp">OnSelchangeComboLang();
</code></pre>
<p>Aber die brauch ich ja da sonnst nur der gewählte String geänder für aber ohne veränderung.</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/6227/problem-mit-combobox</link><generator>RSS for Node</generator><lastBuildDate>Sat, 18 Apr 2026 04:35:21 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/6227.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 15 Jun 2003 09:38:00 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit ComboBox on Sun, 15 Jun 2003 09:38:00 GMT]]></title><description><![CDATA[<p>Ich habe folgendes Problem mit einer ComboBox wenn ich was in einer Combox verändere ruft er das hier auf:</p>
<pre><code class="language-cpp">void CHalfLifeSerialEditDlg::OnSelchangeComboLang() 
{
    CString m_ksa;
    m_ComboLang.GetLBText(m_ComboLang.GetCurSel(), m_ksa);  

    if (m_ksa == &quot;Deutsch&quot;)
    {

        GetDlgItem(IDC_STATIC_OPTIONEN)-&gt;SetWindowText(optionenar[0]);
        GetDlgItem(IDOK)-&gt;SetWindowText(savear[0]);
        GetDlgItem(IDCANCEL)-&gt;SetWindowText(exitar[0]);

    }
    else if (m_ksa == &quot;Englisch&quot;)
    {
        GetDlgItem(IDC_STATIC_OPTIONEN)-&gt;SetWindowText(optionenar[1]);
        GetDlgItem(IDOK)-&gt;SetWindowText(savear[1]);
        GetDlgItem(IDCANCEL)-&gt;SetWindowText(exitar[1]);
    }

    SaveKey(HKEY_LOCAL_MACHINE,&quot;SOFTWARE\\MysticSoft\\HLSE&quot;,&quot;Sprache&quot;,m_ksa);
}
</code></pre>
<p>DAs lauft auch ganz super.</p>
<p>Aber wenn ich am Programm start das auf rufe:</p>
<pre><code class="language-cpp">CString lang = ReadKey(HKEY_LOCAL_MACHINE,&quot;SOFTWARE\\MysticSoft\\HLSE&quot;,&quot;Sprache&quot;);

    if (lang == &quot;Deutsch&quot;)
    {
        m_ComboLang.SetCurSel(m_ComboLang.FindString(-1,&quot;Deutsch&quot;));
    }
    else if (lang == &quot;Englisch&quot;)
    {
        m_ComboLang.SetCurSel(m_ComboLang.FindString(-1,&quot;Englisch&quot;));
    }
    else
    {
        m_ComboLang.SetCurSel(m_ComboLang.FindString(-1,&quot;Deutsch&quot;));
    }

    OnSelchangeComboLang();
</code></pre>
<p>Giebt es eine absturtz. Das liegt an der zeile:</p>
<pre><code class="language-cpp">OnSelchangeComboLang();
</code></pre>
<p>Aber die brauch ich ja da sonnst nur der gewählte String geänder für aber ohne veränderung.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/30248</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/30248</guid><dc:creator><![CDATA[Dieter]]></dc:creator><pubDate>Sun, 15 Jun 2003 09:38:00 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit ComboBox on Sun, 15 Jun 2003 10:11:00 GMT]]></title><description><![CDATA[<p>Ich weiss zwar net, wo du den Code aufrufst, mach ihn aber mal in die OnInitDialog ...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/30249</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/30249</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Sun, 15 Jun 2003 10:11:00 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit ComboBox on Sun, 15 Jun 2003 20:03:00 GMT]]></title><description><![CDATA[<p>Also das:</p>
<pre><code class="language-cpp">CString lang = ReadKey(HKEY_LOCAL_MACHINE,&quot;SOFTWARE\\MysticSoft\\HLSE&quot;,&quot;Sprache&quot;);

    if (lang == &quot;Deutsch&quot;)
    {
        m_ComboLang.SetCurSel(m_ComboLang.FindString(-1,&quot;Deutsch&quot;));
    }
    else if (lang == &quot;Englisch&quot;)
    {
        m_ComboLang.SetCurSel(m_ComboLang.FindString(-1,&quot;Englisch&quot;));
    }
    else
    {
        m_ComboLang.SetCurSel(m_ComboLang.FindString(-1,&quot;Deutsch&quot;));
    }

    OnSelchangeComboLang();
</code></pre>
<p>wirt im OnInitDialog aufgerufen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/30250</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/30250</guid><dc:creator><![CDATA[Dieter]]></dc:creator><pubDate>Sun, 15 Jun 2003 20:03:00 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit ComboBox on Sun, 15 Jun 2003 20:34:00 GMT]]></title><description><![CDATA[<p>ich habe was festgestellt. Es leibt nicht an dem</p>
<pre><code class="language-cpp">OnSelchangeComboLang();
</code></pre>
<p>Sondern an dem Arrays. Denn wenn ich das :</p>
<pre><code class="language-cpp">CString m_ksa;
    m_ComboLang.GetLBText(m_ComboLang.GetCurSel(), m_ksa);  

    if (m_ksa == &quot;Deutsch&quot;)
    {
        /*
        GetDlgItem(IDC_STATIC_OPTIONEN)-&gt;SetWindowText(optionenar[0]);
        GetDlgItem(IDOK)-&gt;SetWindowText(savear[0]);
        GetDlgItem(IDCANCEL)-&gt;SetWindowText(exitar[0]);
        */

    }
    else if (m_ksa == &quot;Englisch&quot;)
    {
        /*
        GetDlgItem(IDC_STATIC_OPTIONEN)-&gt;SetWindowText(optionenar[1]);
        GetDlgItem(IDOK)-&gt;SetWindowText(savear[1]);
        GetDlgItem(IDCANCEL)-&gt;SetWindowText(exitar[1]);
        */
    }

    SaveKey(HKEY_LOCAL_MACHINE,&quot;SOFTWARE\\MysticSoft\\HLSE&quot;,&quot;Sprache&quot;,m_ksa);
</code></pre>
<p>so ausklammere dann geht alles super. Aber wo kann das Problem liegen die Arrays habe ich so erstelt:</p>
<pre><code class="language-cpp">CStringArray optionenar;    
        optionenar.Add(&quot;Optionen&quot;);
    optionenar.Add(&quot;Options&quot;);

    CStringArray savear;
    savear.Add(&quot;Speichern&quot;);
    savear.Add(&quot;Save&quot;);

    CStringArray exitar;
    exitar.Add(&quot;Beenden&quot;);
    exitar.Add(&quot;Exit&quot;);
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/30251</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/30251</guid><dc:creator><![CDATA[Dieter]]></dc:creator><pubDate>Sun, 15 Jun 2003 20:34:00 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit ComboBox on Mon, 16 Jun 2003 04:11:00 GMT]]></title><description><![CDATA[<p>wo erstellst du die arrays und wo deklarierst du die CStrinArray-Variablen? Für mich sieht das so aus, als sind deine CStringArray-Variablen lokal!!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/30252</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/30252</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Mon, 16 Jun 2003 04:11:00 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit ComboBox on Mon, 16 Jun 2003 12:15:00 GMT]]></title><description><![CDATA[<p>Also das:</p>
<pre><code class="language-cpp">CStringArray optionenar;    
    optionenar.Add(&quot;Optionen&quot;);
    optionenar.Add(&quot;Options&quot;);

    CStringArray savear;
    savear.Add(&quot;Speichern&quot;);
    savear.Add(&quot;Save&quot;);

    CStringArray exitar;
    exitar.Add(&quot;Beenden&quot;);
    exitar.Add(&quot;Exit&quot;);
</code></pre>
<p>steht im OnInitDialog .</p>
]]></description><link>https://www.c-plusplus.net/forum/post/30253</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/30253</guid><dc:creator><![CDATA[Dieter]]></dc:creator><pubDate>Mon, 16 Jun 2003 12:15:00 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit ComboBox on Mon, 16 Jun 2003 12:32:00 GMT]]></title><description><![CDATA[<p>jo, die arrays sind loakl erstellt. nach OnInitDialog gibts die nimmer.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/30254</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/30254</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Mon, 16 Jun 2003 12:32:00 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit ComboBox on Mon, 16 Jun 2003 14:53:00 GMT]]></title><description><![CDATA[<p>Das kann ja nicht sein: Denn wenn ich die ComboFunktion Manuel ausführe dann geht es ja. (Eigentlich steht in OnInitDialog nur:</p>
<pre><code class="language-cpp">optionenar.Add(&quot;Optionen&quot;);
    optionenar.Add(&quot;Options&quot;);

    savear.Add(&quot;Speichern&quot;);
    savear.Add(&quot;Save&quot;);

    exitar.Add(&quot;Beenden&quot;);
    exitar.Add(&quot;Exit&quot;);
</code></pre>
<p>in der......dlg.h steht an der richtigen stelle:</p>
<pre><code class="language-cpp">CStringArray optionenar;
    CStringArray savear;
    CStringArray exitar;
</code></pre>
<p>)</p>
<p>Aber es geht Trotzdem nicht aber son sind sie ja nich lokal.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/30255</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/30255</guid><dc:creator><![CDATA[Dieter]]></dc:creator><pubDate>Mon, 16 Jun 2003 14:53:00 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit ComboBox on Mon, 16 Jun 2003 15:36:00 GMT]]></title><description><![CDATA[<p>dann solltest du vielleicht nicht sagen, dass du den ganzen Code, samt Variablendeklaration in der OnInitDialog hast, oder ?!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/30256</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/30256</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Mon, 16 Jun 2003 15:36:00 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit ComboBox on Mon, 16 Jun 2003 16:33:00 GMT]]></title><description><![CDATA[<p>Ja ok hast recht. Aber weist trotzdem keine Rat?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/30257</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/30257</guid><dc:creator><![CDATA[Dieter]]></dc:creator><pubDate>Mon, 16 Jun 2003 16:33:00 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit ComboBox on Tue, 17 Jun 2003 19:45:00 GMT]]></title><description><![CDATA[<p>So ich Poste mal alles noch mal im zusammenhang:</p>
<p>in der ..dgl.h</p>
<pre><code class="language-cpp">CStringArray optionenar;
    CStringArray savear;
    CStringArray exitar;
</code></pre>
<p>in OnInitDialog()</p>
<pre><code class="language-cpp">m_ComboLang.AddString(&quot;Deutsch&quot;);
    m_ComboLang.AddString(&quot;Englisch&quot;);
    m_ComboLang.SetCurSel(m_ComboLang.FindString(-1,&quot;Deutsch&quot;));

    CString lang = ReadKey(HKEY_LOCAL_MACHINE,&quot;SOFTWARE\\MysticSoft\\HLSE&quot;,&quot;Sprache&quot;);

    if (lang == &quot;Deutsch&quot;)
    {
        m_ComboLang.SetCurSel(m_ComboLang.FindString(-1,&quot;Deutsch&quot;));
    }
    else if (lang == &quot;Englisch&quot;)
    {
        m_ComboLang.SetCurSel(m_ComboLang.FindString(-1,&quot;Englisch&quot;));
    }
    else
    {
        m_ComboLang.SetCurSel(m_ComboLang.FindString(-1,&quot;Deutsch&quot;));
    }

    OnSelchangeComboLang();

    optionenar.Add(&quot;Optionen&quot;);
    optionenar.Add(&quot;Options&quot;);

    savear.Add(&quot;Speichern&quot;);
    savear.Add(&quot;Save&quot;);

    exitar.Add(&quot;Beenden&quot;);
    exitar.Add(&quot;Exit&quot;);
</code></pre>
<p>und jetzt die OnSelchangeComboLang() funktion:</p>
<pre><code class="language-cpp">void CTestDlg::OnSelchangeComboLang() 
{
    CString m_ksa;
    m_ComboLang.GetLBText(m_ComboLang.GetCurSel(), m_ksa);  

    if (m_ksa == &quot;Deutsch&quot;)
    {
        GetDlgItem(IDC_STATIC_OPTIONEN)-&gt;SetWindowText(optionenar[0]);
        GetDlgItem(IDOK)-&gt;SetWindowText(savear[0]);
        GetDlgItem(IDCANCEL)-&gt;SetWindowText(exitar[0]);

    }
    else if (m_ksa == &quot;Englisch&quot;)
    {
        GetDlgItem(IDC_STATIC_OPTIONEN)-&gt;SetWindowText(optionenar[1]);
        GetDlgItem(IDOK)-&gt;SetWindowText(savear[1]);
        GetDlgItem(IDCANCEL)-&gt;SetWindowText(exitar[1]);
    }

    SaveKey(HKEY_LOCAL_MACHINE,&quot;SOFTWARE\\MysticSoft\\HLSE&quot;,&quot;Sprache&quot;,m_ksa);
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/30258</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/30258</guid><dc:creator><![CDATA[Dieter]]></dc:creator><pubDate>Tue, 17 Jun 2003 19:45:00 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit ComboBox on Tue, 17 Jun 2003 20:10:00 GMT]]></title><description><![CDATA[<p>Du rufst erst die FUnktion auf und füllst das array danach! Ist doch klar, dass beim funktionsaufruf das array noch leer ist!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/30259</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/30259</guid><dc:creator><![CDATA[dEUs]]></dc:creator><pubDate>Tue, 17 Jun 2003 20:10:00 GMT</pubDate></item></channel></rss>