<?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[Memberfunction pointer aufrufen]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich versuche einen member-function pointer innerhalb einer member-function aufzurufen es gelingt mir jedoch nicht.</p>
<p>.h-File:</p>
<pre><code class="language-cpp">class CommandHandler
{ 
  typedef int (CommandHandler::*FunctionPtr)(void);
   ...
  void handleFunction(FunctionPtr function_ptr);
}
</code></pre>
<p>.cpp-File</p>
<pre><code class="language-cpp">// Aufru
void CommandHandler::func()
{
    FunctionPtr ptr = &amp;CommandHandler::handleCmdConnect;
    handleFunction(ptr);
}

void CommandHandler::handleFunction(FunctionPtr function_ptr)
{
    int ret = this-&gt;*function_ptr();
}
</code></pre>
<p>Fehlermeldung must use .* or -&gt;* to call pointer-to-member function in `function_ptr (...)'</p>
<p>Kann mir jmd weiterhelfen? thx<br />
mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/279693/memberfunction-pointer-aufrufen</link><generator>RSS for Node</generator><lastBuildDate>Mon, 24 Aug 2026 11:09:34 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/279693.rss" rel="self" type="application/rss+xml"/><pubDate>Sat, 01 Jan 2011 17:57:15 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Memberfunction pointer aufrufen on Sat, 01 Jan 2011 17:57:15 GMT]]></title><description><![CDATA[<p>Hallo,</p>
<p>ich versuche einen member-function pointer innerhalb einer member-function aufzurufen es gelingt mir jedoch nicht.</p>
<p>.h-File:</p>
<pre><code class="language-cpp">class CommandHandler
{ 
  typedef int (CommandHandler::*FunctionPtr)(void);
   ...
  void handleFunction(FunctionPtr function_ptr);
}
</code></pre>
<p>.cpp-File</p>
<pre><code class="language-cpp">// Aufru
void CommandHandler::func()
{
    FunctionPtr ptr = &amp;CommandHandler::handleCmdConnect;
    handleFunction(ptr);
}

void CommandHandler::handleFunction(FunctionPtr function_ptr)
{
    int ret = this-&gt;*function_ptr();
}
</code></pre>
<p>Fehlermeldung must use .* or -&gt;* to call pointer-to-member function in `function_ptr (...)'</p>
<p>Kann mir jmd weiterhelfen? thx<br />
mfg</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2001072</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2001072</guid><dc:creator><![CDATA[sputnik54]]></dc:creator><pubDate>Sat, 01 Jan 2011 17:57:15 GMT</pubDate></item><item><title><![CDATA[Reply to Memberfunction pointer aufrufen on Sat, 01 Jan 2011 18:06:18 GMT]]></title><description><![CDATA[<p>1. Falsches Forum: C++ wäre korrekt, hier ist C++/CLI<br />
2. Hier solltest Du die Lösung finden: <a href="http://www.parashift.com/c++-faq-lite/pointers-to-members.html" rel="nofollow">http://www.parashift.com/c++-faq-lite/pointers-to-members.html</a></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2001075</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2001075</guid><dc:creator><![CDATA[theta]]></dc:creator><pubDate>Sat, 01 Jan 2011 18:06:18 GMT</pubDate></item><item><title><![CDATA[Reply to Memberfunction pointer aufrufen on Sat, 01 Jan 2011 18:33:52 GMT]]></title><description><![CDATA[<p>1. Sry für das posting im falschen forum<br />
2. thx für den link</p>
<p>Für meinen Fall lautet die Lösung:</p>
<pre><code class="language-cpp">int ret = (this-&gt;*function_ptr)();
</code></pre>
<p>Die Klammern ham gefehlt <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/2001086</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2001086</guid><dc:creator><![CDATA[sputnik54]]></dc:creator><pubDate>Sat, 01 Jan 2011 18:33:52 GMT</pubDate></item><item><title><![CDATA[Reply to Memberfunction pointer aufrufen on Mon, 03 Jan 2011 09:19:20 GMT]]></title><description><![CDATA[<p>Dieser Thread wurde von Moderator/in <a href="http://www.c-plusplus.net/forum/u18363" rel="nofollow">Jochen Kalmbach</a> aus dem Forum <a href="http://www.c-plusplus.net/forum/f58" rel="nofollow">C++/CLI mit .NET</a> in das Forum <a href="http://www.c-plusplus.net/forum/f15" rel="nofollow">C++ (auch C++0x)</a> verschoben.</p>
<p>Im Zweifelsfall bitte auch folgende Hinweise beachten:<br />
<a href="http://www.c-plusplus.net/forum/39405" rel="nofollow">C/C++ Forum :: FAQ - Sonstiges :: Wohin mit meiner Frage?</a></p>
<p><em>Dieses Posting wurde automatisch erzeugt.</em></p>
]]></description><link>https://www.c-plusplus.net/forum/post/2001561</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2001561</guid><dc:creator><![CDATA[C++ Forumbot]]></dc:creator><pubDate>Mon, 03 Jan 2011 09:19:20 GMT</pubDate></item></channel></rss>