<?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[Wie kann ich SendMessage einen Parameter mitgeben? (Zeiger oder CString)]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich habe es schon mit casten versucht, aber das funktioniert nicht.</p>
<p>Alternativ hilft mir auch die Antwort, welche Funktion aufgerufen wird, wenn ein Document aktiv wird. OnInitialUpdate beim View passt jedenfalls nicht, die wird zu früh aufgerufen. OnShowWindow reagierte überhaupt nicht.</p>
<p><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/topic/80897/wie-kann-ich-sendmessage-einen-parameter-mitgeben-zeiger-oder-cstring</link><generator>RSS for Node</generator><lastBuildDate>Fri, 17 Apr 2026 19:43:50 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/80897.rss" rel="self" type="application/rss+xml"/><pubDate>Mon, 26 Jul 2004 09:52:26 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Wie kann ich SendMessage einen Parameter mitgeben? (Zeiger oder CString) on Mon, 26 Jul 2004 09:52:26 GMT]]></title><description><![CDATA[<p>Hallo!</p>
<p>Ich habe es schon mit casten versucht, aber das funktioniert nicht.</p>
<p>Alternativ hilft mir auch die Antwort, welche Funktion aufgerufen wird, wenn ein Document aktiv wird. OnInitialUpdate beim View passt jedenfalls nicht, die wird zu früh aufgerufen. OnShowWindow reagierte überhaupt nicht.</p>
<p><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/568322</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/568322</guid><dc:creator><![CDATA[estartu]]></dc:creator><pubDate>Mon, 26 Jul 2004 09:52:26 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann ich SendMessage einen Parameter mitgeben? (Zeiger oder CString) on Mon, 26 Jul 2004 10:29:10 GMT]]></title><description><![CDATA[<p>Servus,</p>
<p>aufbasse:</p>
<pre><code class="language-cpp">void CDeinDlg::OnRubbelDieKatz
{
	LPCSTR strKatze = &quot;RubbeldieKatz!!!&quot;;
	PostMessage(MESSAGE_TEST, (WPARAM)strKatze, 0);
}

BOOL CDeinDlg::PreTranslateMessage(MSG* pMsg)
{
	if (pMsg-&gt;message == MESSAGE_TEST)
	{
		LPCSTR strKatze = (LPCSTR)pMsg-&gt;wParam;
		CString strNagelAnDieWand = strKatze;
	}

	return CDialog::PreTranslateMessage(pMsg);
}
</code></pre>
<p>Ich weiss nicht ob das die feine Art ist. Aber bisher hatte ich das immer so gemacht. <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="😃"
    /></p>
<p>*winke*<br />
Hellsgore</p>
]]></description><link>https://www.c-plusplus.net/forum/post/568347</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/568347</guid><dc:creator><![CDATA[Hellsgore]]></dc:creator><pubDate>Mon, 26 Jul 2004 10:29:10 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann ich SendMessage einen Parameter mitgeben? (Zeiger oder CString) on Mon, 26 Jul 2004 12:12:39 GMT]]></title><description><![CDATA[<p>Danke!!! Fühl dich gedrückt!</p>
<p>Ich hab es zwar irgendwie ganz anders, aber es geht auch.</p>
<pre><code class="language-cpp">AfxGetMainWnd()-&gt;SendMessage(WM_UPDATE_TEXTE, (WPARAM)GetDocument());
</code></pre>
<p>Und im MainFrame:</p>
<pre><code class="language-cpp">BEGIN_MESSAGE_MAP(CMainFrame, CFrameWnd)
	//{{AFX_MSG_MAP(CMainFrame)
         // ...
	//}}AFX_MSG_MAP
	ON_MESSAGE(WM_UPDATE_TEXTE, OnUpdateTexte)
END_MESSAGE_MAP()

LRESULT CMainFrame::OnUpdateTexte(WPARAM wParam, LPARAM pParam)
{
	CBasisDoc* pDoc = (CBasisDoc*)(wParam);
	ASSERT(pDoc);
	if (pDoc)
	{
		// Und so weiter :)
	}

	return 0;
}
</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/568423</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/568423</guid><dc:creator><![CDATA[estartu]]></dc:creator><pubDate>Mon, 26 Jul 2004 12:12:39 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann ich SendMessage einen Parameter mitgeben? (Zeiger oder CString) on Mon, 26 Jul 2004 13:30:26 GMT]]></title><description><![CDATA[<blockquote>
<pre><code class="language-cpp">LPCSTR strKatze = &quot;RubbeldieKatz!!!&quot;;
PostMessage(MESSAGE_TEST, (WPARAM)strKatze, 0);
</code></pre>
</blockquote>
<p>Verschicke nie Zeiger mit PostMessage. Das ist tödlich. Nimm SendMessage.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/568532</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/568532</guid><dc:creator><![CDATA[~~~~~+]]></dc:creator><pubDate>Mon, 26 Jul 2004 13:30:26 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann ich SendMessage einen Parameter mitgeben? (Zeiger oder CString) on Mon, 26 Jul 2004 13:47:04 GMT]]></title><description><![CDATA[<p>Warum?</p>
<p>Er kommt direkt zurück und wartet nicht bis es abgearbeitet ist. Aber warum soll man das nicht? <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f615.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--confused_face"
      title=":confused:"
      alt="😕"
    /></p>
<p>*winke*<br />
Hellsgore</p>
]]></description><link>https://www.c-plusplus.net/forum/post/568553</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/568553</guid><dc:creator><![CDATA[Hellsgore]]></dc:creator><pubDate>Mon, 26 Jul 2004 13:47:04 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann ich SendMessage einen Parameter mitgeben? (Zeiger oder CString) on Mon, 26 Jul 2004 13:49:33 GMT]]></title><description><![CDATA[<p>Na weil der Zeiger dann, wenn du Pech hast, schon ungültig ist, wenn die Nachricht bearbeitet wird.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/568557</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/568557</guid><dc:creator><![CDATA[~~~~~~+]]></dc:creator><pubDate>Mon, 26 Jul 2004 13:49:33 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann ich SendMessage einen Parameter mitgeben? (Zeiger oder CString) on Mon, 26 Jul 2004 13:51:36 GMT]]></title><description><![CDATA[<p>Ich glaube ich könnte sogar &quot;wenn du Pech hast&quot; rausnehmen. Er wird immer ungültig sein, wenn das Objekt nicht mit new erzeugt wurde.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/568561</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/568561</guid><dc:creator><![CDATA[~~~~~~~+]]></dc:creator><pubDate>Mon, 26 Jul 2004 13:51:36 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann ich SendMessage einen Parameter mitgeben? (Zeiger oder CString) on Mon, 26 Jul 2004 13:53:31 GMT]]></title><description><![CDATA[<p>Ok, jetzt noch ein drittes Post <img
      src="https://www.c-plusplus.net/forum/plugins/nodebb-plugin-emoji/emoji/emoji-one/1f921.png?v=ab1pehoraso"
      class="not-responsive emoji emoji-emoji-one emoji--clown_face"
      title=":clown:"
      alt="🤡"
    /></p>
<p>Bei Stringliteralen wird es doch kein Problem geben.</p>
<p>Aber bei anderen Zeigern schon.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/568566</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/568566</guid><dc:creator><![CDATA[~~~~~~~+]]></dc:creator><pubDate>Mon, 26 Jul 2004 13:53:31 GMT</pubDate></item><item><title><![CDATA[Reply to Wie kann ich SendMessage einen Parameter mitgeben? (Zeiger oder CString) on Mon, 26 Jul 2004 14:18:00 GMT]]></title><description><![CDATA[<p>Das ist Lötzinn: :p</p>
<pre><code class="language-+">&gt; ...Er wird immer ungültig sein, wenn das Objekt nicht mit new erzeugt wurde.

Daran habe ich nicht gedacht: ;)  

~~~~~~~+ schrieb:  
&gt; Na weil der Zeiger dann, wenn du Pech hast, schon ungültig ist, wenn die Nachricht bearbeitet wird.

\*winke\*  
Hellsgore</code></pre>
]]></description><link>https://www.c-plusplus.net/forum/post/568598</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/568598</guid><dc:creator><![CDATA[Hellsgore]]></dc:creator><pubDate>Mon, 26 Jul 2004 14:18:00 GMT</pubDate></item></channel></rss>