<?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 swith]]></title><description><![CDATA[<p>moin, ichh abe ein problem:</p>
<pre><code class="language-cpp">int cSelect = SendMessage(hChannel, CB_GETCURSEL, 0, 0);
                switch(cSelect)
                {
                    case index_design_0:
                        MessageBox(NULL, &quot;Desgin&quot;, &quot;SinSupport&quot;, MB_OK); 
                       break;
                    case index_code_0:

                        break;
                    case index_info_0:

                        break;
                    case index_info_1:

                        break;
                    case index_support_0:

                        break;
                    default:
                        MessageBox(NULL, &quot;Bitte wählen Sie ein Channel aus !&quot;, &quot;SinSupport&quot;, MB_OK);   
                }
</code></pre>
<p>die indexe vonj der combobox werden in varibalen gespeichert und ich will jetzt rausfinden welche das sind...<br />
abe rich bekomme en error:</p>
<p>sinsupport.main.cpp: In function <code>LRESULT WindowProcedure(HWND__*, UINT, WPARAM, LPARAM)': sinsupport.main.cpp:189: error:</code>index_design_0' cannot appear in a constant-expression<br />
sinsupport.main.cpp:192: error: <code>index\_code\_0' cannot appear in a constant-expression sinsupport.main.cpp:195: error:</code>index_info_0' cannot appear in a constant-expression<br />
sinsupport.main.cpp:198: error: <code>index\_info\_1' cannot appear in a constant-expression sinsupport.main.cpp:201: error:</code>index_support_0' cannot appear in a constant-expression</p>
<p>ich benutze DevC++</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/140578/problem-mit-swith</link><generator>RSS for Node</generator><lastBuildDate>Mon, 31 Aug 2026 04:23:08 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/140578.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 15 Mar 2006 19:07:22 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to problem mit swith on Wed, 15 Mar 2006 19:07:22 GMT]]></title><description><![CDATA[<p>moin, ichh abe ein problem:</p>
<pre><code class="language-cpp">int cSelect = SendMessage(hChannel, CB_GETCURSEL, 0, 0);
                switch(cSelect)
                {
                    case index_design_0:
                        MessageBox(NULL, &quot;Desgin&quot;, &quot;SinSupport&quot;, MB_OK); 
                       break;
                    case index_code_0:

                        break;
                    case index_info_0:

                        break;
                    case index_info_1:

                        break;
                    case index_support_0:

                        break;
                    default:
                        MessageBox(NULL, &quot;Bitte wählen Sie ein Channel aus !&quot;, &quot;SinSupport&quot;, MB_OK);   
                }
</code></pre>
<p>die indexe vonj der combobox werden in varibalen gespeichert und ich will jetzt rausfinden welche das sind...<br />
abe rich bekomme en error:</p>
<p>sinsupport.main.cpp: In function <code>LRESULT WindowProcedure(HWND__*, UINT, WPARAM, LPARAM)': sinsupport.main.cpp:189: error:</code>index_design_0' cannot appear in a constant-expression<br />
sinsupport.main.cpp:192: error: <code>index\_code\_0' cannot appear in a constant-expression sinsupport.main.cpp:195: error:</code>index_info_0' cannot appear in a constant-expression<br />
sinsupport.main.cpp:198: error: <code>index\_info\_1' cannot appear in a constant-expression sinsupport.main.cpp:201: error:</code>index_support_0' cannot appear in a constant-expression</p>
<p>ich benutze DevC++</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1017054</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017054</guid><dc:creator><![CDATA[tütü]]></dc:creator><pubDate>Wed, 15 Mar 2006 19:07:22 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit swith on Wed, 15 Mar 2006 19:21:36 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>von welchem Typ sind index_design_0 und Konsorten?<br />
Bedingungs-Ausdrücke in switch müßen konstant sein, wie die Fehlermeldung auch sagt.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1017075</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017075</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 15 Mar 2006 19:21:36 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit swith on Wed, 15 Mar 2006 19:22:36 GMT]]></title><description><![CDATA[<p>die variablen index_desgin_0, index_code_0 etc sind vom type int</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1017077</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017077</guid><dc:creator><![CDATA[tütü]]></dc:creator><pubDate>Wed, 15 Mar 2006 19:22:36 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit swith on Wed, 15 Mar 2006 19:24:17 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>aber sie müßen zusätzlich noch <em>const</em> sein.<br />
Eventuell ist es machbar, all diese Werte als Typen eines enums einzubinden.</p>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1017079</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017079</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 15 Mar 2006 19:24:17 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit swith on Wed, 15 Mar 2006 19:25:28 GMT]]></title><description><![CDATA[<p>nagut, dann muss ich halt konstanten erstellen</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1017082</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017082</guid><dc:creator><![CDATA[tütüt]]></dc:creator><pubDate>Wed, 15 Mar 2006 19:25:28 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit swith on Wed, 15 Mar 2006 19:30:29 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">const int cindex_design_0 = index_design_0;
                const int cindex_code_0 = index_code_0;
                const int cindex_info_0 = index_info_0;
                const int cindex_info_1 = index_info_1;
                const int cindex_support_0 = index_support_0;
                int cSelect = SendMessage(hChannel, CB_GETCURSEL, 0, 0);
                switch(cSelect)
                {
                    case cindex_design_0:
                        MessageBox(NULL, &quot;Desgin&quot;, &quot;SinSupport&quot;, MB_OK); 
                       break;
                    case cindex_code_0:

                        break;
                    case cindex_info_0:

                        break;
                    case icndex_info_1:

                        break;
                    case cindex_support_0:

                        break;
                    default:
                        MessageBox(NULL, &quot;Bitte wählen Sie ein Channel aus !&quot;, &quot;SinSupport&quot;, MB_OK);   
                }
</code></pre>
<p>so geht auch net <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f61e.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--disappointed_face"
      title=":("
      alt="😞"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/1017086</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017086</guid><dc:creator><![CDATA[tütü]]></dc:creator><pubDate>Wed, 15 Mar 2006 19:30:29 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit swith on Wed, 15 Mar 2006 19:33:28 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">enum my_type { MY_TYPE_1, MY_TYPE_2, MY_TYPE_3 };
my_type a_type = ...;
...
switch(a_type)
{
case MY_TYPE_1:
...
break;

case MY_TYPE_2:
...
break;

...
default:
...
break;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1017089</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017089</guid><dc:creator><![CDATA[#benutzername]]></dc:creator><pubDate>Wed, 15 Mar 2006 19:33:28 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit swith on Wed, 15 Mar 2006 19:49:59 GMT]]></title><description><![CDATA[<p>öhm habe en eror ^^</p>
<pre><code class="language-cpp">enum change{
                cindex_design_0,
                cindex_code_0,
                cindex_info_0,
                cindex_info_1,
                cindex_support_0
                };
                int cSelect = SendMessage(hChannel, CB_GETCURSEL, 0, 0);
                change cselect = index_design_0,
                index_code_0,
                index_info_0,
                index_info_1,
                index_support_0;
                switch(cselect)
                {
                    case cindex_design_0:
                        MessageBox(NULL, &quot;Desgin&quot;, &quot;SinSupport&quot;, MB_OK); 
                       break;
                    case cindex_code_0:

                        break;
                    case cindex_info_0:

                        break;
                    case cindex_info_1:

                        break;
                    case cindex_support_0:

                        break;
                    default:
                        MessageBox(NULL, &quot;Bitte wählen Sie ein Channel aus !&quot;, &quot;SinSupport&quot;, MB_OK);   
                }
</code></pre>
<p>194 F:\Dev-Cpp\projects\sinsupport.main.cpp invalid conversion from `int' to `WindowProcedure(HWND__*, UINT, WPARAM, LPARAM)::change'</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1017103</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017103</guid><dc:creator><![CDATA[tütü]]></dc:creator><pubDate>Wed, 15 Mar 2006 19:49:59 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit swith on Wed, 15 Mar 2006 20:04:38 GMT]]></title><description><![CDATA[<p>Hallo</p>
<p>Was soll denn das sein?</p>
<pre><code class="language-cpp">change cselect = index_design_0,
                index_code_0,
                index_info_0,
                index_info_1,
                index_support_0;
</code></pre>
<p>bis bald<br />
akari</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1017123</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017123</guid><dc:creator><![CDATA[akari]]></dc:creator><pubDate>Wed, 15 Mar 2006 20:04:38 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit swith on Wed, 15 Mar 2006 20:15:14 GMT]]></title><description><![CDATA[<p>ein versuch ^ich weis net wie ich es machen kann</p>
]]></description><link>https://www.c-plusplus.net/forum/post/1017130</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017130</guid><dc:creator><![CDATA[tütü]]></dc:creator><pubDate>Wed, 15 Mar 2006 20:15:14 GMT</pubDate></item><item><title><![CDATA[Reply to problem mit swith on Wed, 15 Mar 2006 20:42:49 GMT]]></title><description><![CDATA[<p>du kannst im enum auch angeben, welchen int-werten die einzelnen typen entsprechen sollen</p>
<p>bsp:</p>
<pre><code class="language-cpp">enum MEIN_ENUM { ERSTER_WERT = 2, ZWEITER_WERT = 99, DRITTER_WERT = 1337 };
</code></pre>
<p>giebst du nichts an, also:</p>
<pre><code class="language-cpp">enum MEIN_ENUM { ERSTER_WERT, ZWEITER_WERT, DRITTER_WERT };
</code></pre>
<p>macht der compiler daraus:</p>
<pre><code class="language-cpp">enum MEIN_ENUM { ERSTER_WERT = 0, ZWEITER_WERT = 1, DRITTER_WERT = 2 };
</code></pre>
<p>eine variable vom einem enum-typ ist im grunde ein int, diese eigenschaft kannst du dir zu nutze machen:</p>
<p>d.h.nehmen wir mal an eine funktion ABC() kann entweder A, B oder C rausgeben.<br />
Wobei eine 77 ein A bedeutet, ein 99 ein B und ein 102 ein C, dann kannst du das so machen:</p>
<pre><code class="language-cpp">enum E_ABC { ABC_A = 77, ABC_B = 99, ABC_C = 102 };

E_ABC returnValue = (E_ABC) ABC(); // eventuell gehts auch ohne den (E_ABC)-Cast

switch(returnValue)
{
case ABC_A:
do_some_stuff();
break;

case ABC_B:
do_some_other_stuff();
break;

case ABC_C:
do_some_very_other_stuff();
break;

default:
... // errormsg bzw. exception werfen
break;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/1017151</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/1017151</guid><dc:creator><![CDATA[#benutzername]]></dc:creator><pubDate>Wed, 15 Mar 2006 20:42:49 GMT</pubDate></item></channel></rss>