<?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 Messages]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>ich habe da ein Problem,</p>
<p>ich habe mit VS 6.0 gearbeitet und habe dann nach V C++ .net gewechselt.<br />
Jetzt bekomme ich beim Kompelieren eine Fehlermeldung die ich nicht ganz verstehe.</p>
<p>Ich sende eine Nachricht aus einer Funktion an CMainFrame mit</p>
<pre><code class="language-cpp">#define WM_MY_ADDTRING_MESSAGE WM_USER+1 

... 
// in der Funktion
char *str = &quot;Hallo&quot;; 
AfxGetMainWnd()-&gt;SendMessage(WM_MY_ADDTRING_MESSAGE,(WPARAM)str); 

// in der CMainFrame
BEGIN_MESSAGE_MAP... 
... 
ON_MESSAGE( WM_MY_ADDTRING_MESSAGE, OnMyAddstringMessage ) 
... 
END_MESSAGE_MAP() 

void CMainFrame::OnMyAddstringMessage(WPARAM wParam, LPARAM pParam) 
{ 
   char *myString = (char*)wParam; 
   // hier gehts weiter.... 
}
</code></pre>
<p>der Kompiler spukt folgenden Fehler aus :</p>
<pre><code class="language-cpp">MainFrm.cpp(22) : error C2440: 'static_cast': 'void (__thiscall CMainFrame::* )(WPARAM,LPARAM)' kann nicht in 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)' konvertiert werden
</code></pre>
<p>Was kann ich nun machen ??</p>
<p>Gruß<br />
andy_mann</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/76932/problem-mit-messages</link><generator>RSS for Node</generator><lastBuildDate>Fri, 24 Apr 2026 14:24:48 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/76932.rss" rel="self" type="application/rss+xml"/><pubDate>Wed, 16 Jun 2004 09:11:57 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Problem mit Messages on Wed, 16 Jun 2004 09:11:57 GMT]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>ich habe da ein Problem,</p>
<p>ich habe mit VS 6.0 gearbeitet und habe dann nach V C++ .net gewechselt.<br />
Jetzt bekomme ich beim Kompelieren eine Fehlermeldung die ich nicht ganz verstehe.</p>
<p>Ich sende eine Nachricht aus einer Funktion an CMainFrame mit</p>
<pre><code class="language-cpp">#define WM_MY_ADDTRING_MESSAGE WM_USER+1 

... 
// in der Funktion
char *str = &quot;Hallo&quot;; 
AfxGetMainWnd()-&gt;SendMessage(WM_MY_ADDTRING_MESSAGE,(WPARAM)str); 

// in der CMainFrame
BEGIN_MESSAGE_MAP... 
... 
ON_MESSAGE( WM_MY_ADDTRING_MESSAGE, OnMyAddstringMessage ) 
... 
END_MESSAGE_MAP() 

void CMainFrame::OnMyAddstringMessage(WPARAM wParam, LPARAM pParam) 
{ 
   char *myString = (char*)wParam; 
   // hier gehts weiter.... 
}
</code></pre>
<p>der Kompiler spukt folgenden Fehler aus :</p>
<pre><code class="language-cpp">MainFrm.cpp(22) : error C2440: 'static_cast': 'void (__thiscall CMainFrame::* )(WPARAM,LPARAM)' kann nicht in 'LRESULT (__thiscall CWnd::* )(WPARAM,LPARAM)' konvertiert werden
</code></pre>
<p>Was kann ich nun machen ??</p>
<p>Gruß<br />
andy_mann</p>
]]></description><link>https://www.c-plusplus.net/forum/post/541358</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541358</guid><dc:creator><![CDATA[andy_mann]]></dc:creator><pubDate>Wed, 16 Jun 2004 09:11:57 GMT</pubDate></item><item><title><![CDATA[Reply to Problem mit Messages on Wed, 16 Jun 2004 10:38:22 GMT]]></title><description><![CDATA[<p>Hat sich erledigt,</p>
<p>die Funktion darf nicht void sein, sondern LRESULT.</p>
<p>Gruß<br />
andy_mann</p>
]]></description><link>https://www.c-plusplus.net/forum/post/541438</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/541438</guid><dc:creator><![CDATA[andy_mann]]></dc:creator><pubDate>Wed, 16 Jun 2004 10:38:22 GMT</pubDate></item></channel></rss>