<?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[Fehler bei dem Edit Feld?]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe folgendes Problem.</p>
<p>Ich will den Text aus einem Edit Feld auslesen und dann in einer MsgBox ausgeben, nur klappt das nicht. Ich bekomme immer einen (Laufzeit)Fehler (Ungültiger Speicherzugriff).</p>
<p>hWnd ist das Handle des Eltern Fensters.</p>
<p>...</p>
<pre><code class="language-cpp">case WM_CREATE:
		hWnd3 = CreateWindow(&quot;edit&quot;, &quot;Test&quot; , WS_CHILD | WS_VISIBLE | WS_BORDER, 200, 50, 100, 20, hWnd,(HMENU) 1, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE), NULL);
		hWnd2 = CreateWindow(&quot;button&quot;, &quot;Übernehmen&quot;, WS_VISIBLE | WS_CHILD, 270, 300, 100, 50, hWnd,(HMENU) 2, (HINSTANCE)
GetWindowLong(hWnd,GWL_HINSTANCE), NULL);
		return 0 ;
		break;
	case WM_COMMAND:
		switch(LOWORD(wParam))
		{	
	        case 2:
		  LPSTR str;
		  GetDlgItemText(hWnd3, NULL, str, 10);
		  MessageBox(NULL, str, &quot;Test&quot;, 0);
		  break;
		}
		break;
</code></pre>
<p>...</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/67701/fehler-bei-dem-edit-feld</link><generator>RSS for Node</generator><lastBuildDate>Wed, 08 Apr 2026 08:36:51 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/67701.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 10 Mar 2004 17:00:18 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fehler bei dem Edit Feld? on Wed, 10 Mar 2004 17:00:18 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>Ich habe folgendes Problem.</p>
<p>Ich will den Text aus einem Edit Feld auslesen und dann in einer MsgBox ausgeben, nur klappt das nicht. Ich bekomme immer einen (Laufzeit)Fehler (Ungültiger Speicherzugriff).</p>
<p>hWnd ist das Handle des Eltern Fensters.</p>
<p>...</p>
<pre><code class="language-cpp">case WM_CREATE:
		hWnd3 = CreateWindow(&quot;edit&quot;, &quot;Test&quot; , WS_CHILD | WS_VISIBLE | WS_BORDER, 200, 50, 100, 20, hWnd,(HMENU) 1, (HINSTANCE) GetWindowLong(hWnd, GWL_HINSTANCE), NULL);
		hWnd2 = CreateWindow(&quot;button&quot;, &quot;Übernehmen&quot;, WS_VISIBLE | WS_CHILD, 270, 300, 100, 50, hWnd,(HMENU) 2, (HINSTANCE)
GetWindowLong(hWnd,GWL_HINSTANCE), NULL);
		return 0 ;
		break;
	case WM_COMMAND:
		switch(LOWORD(wParam))
		{	
	        case 2:
		  LPSTR str;
		  GetDlgItemText(hWnd3, NULL, str, 10);
		  MessageBox(NULL, str, &quot;Test&quot;, 0);
		  break;
		}
		break;
</code></pre>
<p>...</p>
]]></description><link>https://www.c-plusplus.net/forum/post/477686</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/477686</guid><dc:creator><![CDATA[flammenvogel]]></dc:creator><pubDate>Wed, 10 Mar 2004 17:00:18 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler bei dem Edit Feld? on Wed, 10 Mar 2004 17:02:58 GMT]]></title><description><![CDATA[<p>Du musst für str schon Speicher reservieren <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/477689</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/477689</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Wed, 10 Mar 2004 17:02:58 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler bei dem Edit Feld? on Wed, 10 Mar 2004 17:05:50 GMT]]></title><description><![CDATA[<p>Könnte mir auch noch jemand verraten wie ich das mache, bin Anfänger.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/477696</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/477696</guid><dc:creator><![CDATA[flammenvogel]]></dc:creator><pubDate>Wed, 10 Mar 2004 17:05:50 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler bei dem Edit Feld? on Wed, 10 Mar 2004 19:40:06 GMT]]></title><description><![CDATA[<pre><code class="language-cpp">TCHAR str[10];
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/477928</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/477928</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Wed, 10 Mar 2004 19:40:06 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler bei dem Edit Feld? on Wed, 10 Mar 2004 21:27:39 GMT]]></title><description><![CDATA[<p>Wenn ich das für LPSTR einsetze, kommt zwar keine Fehlermeldung, doch die MessageBox ist leer. Obwohl ich in dem Feld was eingegeben habe.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/478022</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/478022</guid><dc:creator><![CDATA[flammenvogel]]></dc:creator><pubDate>Wed, 10 Mar 2004 21:27:39 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler bei dem Edit Feld? on Wed, 10 Mar 2004 22:04:57 GMT]]></title><description><![CDATA[<p>Du musst im 2. Parameter von GetDlgItemText noch die ID übergeben (bei dir 1) und statt hWnd3 musst du das Handle des Parent nehmen (bei dir hwnd) - oder du nimmst anstelle von GetDlgItemText die Funktion <a href="http://msdn.microsoft.com/library/en-us/winui/winui/windowsuserinterface/windowing/windows/windowreference/windowfunctions/getwindowtext.asp" rel="nofollow">GetWindowText</a> (da gibst du dann anstelle von Parent-Handle und ID direkt das Handle des abzufragenden Fensters an) <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/478055</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/478055</guid><dc:creator><![CDATA[flenders]]></dc:creator><pubDate>Wed, 10 Mar 2004 22:04:57 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler bei dem Edit Feld? on Thu, 11 Mar 2004 12:31:02 GMT]]></title><description><![CDATA[<p>Du hast einige Fehler gemacht:</p>
<p>1. Du solltest ersteinmal ein bisschen Speicher für den String reservieren.<br />
z.b.:</p>
<pre><code class="language-cpp">TCHAR String[20]
</code></pre>
<p>2. Du solltest danach eine Funktion Namens &quot;GetWindowText&quot; benutzen. (Die Parameterinfos kannst du in der msdn nachgucken). Es gibt auch ein Gegenstück Namens &quot;SetWindowText&quot; mit der du direkt Text setzen kannst. Du kannst natürlich auch Nachrichten schicken, was aber hier zu umständlich wäre. (Diese beiden Techniken funktionieren auch mit &quot;echten&quot; Fenstern. <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f642.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--slightly_smiling_face"
      title=":)"
      alt="🙂"
    /></p>
]]></description><link>https://www.c-plusplus.net/forum/post/478209</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/478209</guid><dc:creator><![CDATA[jeanlebon]]></dc:creator><pubDate>Thu, 11 Mar 2004 12:31:02 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler bei dem Edit Feld? on Thu, 11 Mar 2004 14:02:27 GMT]]></title><description><![CDATA[<p>Danke es geht jetzt.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/478305</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/478305</guid><dc:creator><![CDATA[flammenvogel]]></dc:creator><pubDate>Thu, 11 Mar 2004 14:02:27 GMT</pubDate></item></channel></rss>