<?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 und CB_GETLBTEXT]]></title><description><![CDATA[<p>Hi@all<br />
ich habe in einem Programm (mit UNICODE kompiliert) eine Funktion um den aktuellen Text aus einer ComboBox zu extrahieren. Hierzu verwende ich CB_GETCURSEL um den Index des aktuellen Items zu bekommen und CB_GETLBTEXT um den Text zu bekommen. Der Compiler meldet auch keinen Fehler aber das Programm hängt sich während der Ausführung an dieser Stelle auf. Weiss irgend jemand was daran falsch sein könnte?</p>
<p>Code:<br />
[cpp]<br />
wchar_t* ComboBoxGetItem(HWND hDlg, int id)<br />
{<br />
HWND hwnd = GetDlgItem(hDlg, id);<br />
LRESULT lIndex;<br />
wchar_t* lpOutput;<br />
wchar_t lpText[50] = L&quot;&quot;;</p>
<p>if(!hwnd) return NULL;</p>
<p>lIndex = SendMessage(hwnd, CB_GETCURSEL, 0, 0);<br />
if(lIndex == CB_ERR) return NULL;</p>
<p>if(SendMessage(hwnd, CB_GETLBTEXT, (WPARAM)lIndex, (LPARAM)lpText == CB_ERR))<br />
return NULL;</p>
<p>lpOutput = wcsdup(lpText);<br />
return lpOutput;<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/115667/problem-mit-combobox-und-cb_getlbtext</link><generator>RSS for Node</generator><lastBuildDate>Thu, 02 Jul 2026 22:21:17 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/115667.rss" rel="self" type="application/rss+xml"/><pubDate>Sun, 17 Jul 2005 17:23:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit ComboBox und CB_GETLBTEXT on Sun, 17 Jul 2005 17:23:35 GMT]]></title><description><![CDATA[<p>Hi@all<br />
ich habe in einem Programm (mit UNICODE kompiliert) eine Funktion um den aktuellen Text aus einer ComboBox zu extrahieren. Hierzu verwende ich CB_GETCURSEL um den Index des aktuellen Items zu bekommen und CB_GETLBTEXT um den Text zu bekommen. Der Compiler meldet auch keinen Fehler aber das Programm hängt sich während der Ausführung an dieser Stelle auf. Weiss irgend jemand was daran falsch sein könnte?</p>
<p>Code:<br />
[cpp]<br />
wchar_t* ComboBoxGetItem(HWND hDlg, int id)<br />
{<br />
HWND hwnd = GetDlgItem(hDlg, id);<br />
LRESULT lIndex;<br />
wchar_t* lpOutput;<br />
wchar_t lpText[50] = L&quot;&quot;;</p>
<p>if(!hwnd) return NULL;</p>
<p>lIndex = SendMessage(hwnd, CB_GETCURSEL, 0, 0);<br />
if(lIndex == CB_ERR) return NULL;</p>
<p>if(SendMessage(hwnd, CB_GETLBTEXT, (WPARAM)lIndex, (LPARAM)lpText == CB_ERR))<br />
return NULL;</p>
<p>lpOutput = wcsdup(lpText);<br />
return lpOutput;<br />
}</p>
]]></description><link>https://www.c-plusplus.net/forum/post/832973</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/832973</guid><dc:creator><![CDATA[Tommy 84]]></dc:creator><pubDate>Sun, 17 Jul 2005 17:23:35 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit ComboBox und CB_GETLBTEXT on Sun, 17 Jul 2005 18:27:39 GMT]]></title><description><![CDATA[<p>hi,</p>
<p>wie mir scheint ist die if bedingung falsch:<br />
if(SendMessage(hwnd, CB_GETLBTEXT, (WPARAM)lIndex, (LPARAM)lpText == CB_ERR))</p>
<p>so ist sie richtig, klammerproblem:<br />
if(SendMessage(hwnd, CB_GETLBTEXT, (WPARAM)lIndex, (LPARAM)lpText) == CB_ERR)</p>
<p>gruss<br />
msp</p>
]]></description><link>https://www.c-plusplus.net/forum/post/833014</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/833014</guid><dc:creator><![CDATA[msp]]></dc:creator><pubDate>Sun, 17 Jul 2005 18:27:39 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit ComboBox und CB_GETLBTEXT on Sun, 17 Jul 2005 18:33:22 GMT]]></title><description><![CDATA[<p>mann o mann...peinlich <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f644.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--face_with_rolling_eyes"
      title=":rolling_eyes:"
      alt="🙄"
    /> <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f603.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--grinning_face_with_big_eyes"
      title=":D"
      alt="😃"
    /><br />
danke!</p>
]]></description><link>https://www.c-plusplus.net/forum/post/833017</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/833017</guid><dc:creator><![CDATA[Tommy 84]]></dc:creator><pubDate>Sun, 17 Jul 2005 18:33:22 GMT</pubDate></item></channel></rss>