<?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: &amp;quot;is inaccessible ... within this context&amp;quot;]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>ich arbeite gerade mit einer nicht von mir geschriebenen Bibliothek und habe einige Probleme beim Kompilieren.</p>
<p>Mein System: Windows 7 64bit, minGW, WXWidgets 2.9.1</p>
<pre><code>g++ -I .  -DNOSCANFW -g -Wall  `wx-config --cxxflags` -fno-strict-aliasing -c vi
sual/ImageWindow.cpp -o some_machine/objvis/ImageWindow.o
C:/MinGW/include/wx-2.9/wx/event.h: In member function 'void ice::iceImageWindow::OnChar(wxKeyEvent&amp;)':
C:/MinGW/include/wx-2.9/wx/event.h:2997:18: error: 'virtual bool wxEvtHandler::ProcessEvent(wxEvent&amp;)' is inaccessible
visual/ImageWindow.cpp:266:54: error: within this context
</code></pre>
<p>Diese Fehlermeldung erhalte ich, wenn ich versuche ImageWindow.cpp zu kompilieren. Ich kann damit nicht viel anfangen. Wenn ich mir die Klasse anschaue, dann scheint dort alles korrekt.</p>
<p>Hier mal noch die ImageWindow.cpp:</p>
<pre><code class="language-cpp">...
void iceImageWindow::OnChar(wxKeyEvent&amp; KeyEvent)
  {
    // processes key events are: plus and minus key 
    // for zooming (the rest will do the scroll helper class for us)
    if (KeyEvent.GetKeyCode() == '&gt;')
      {
	// ZoomFactor -1 is essentially the same as ZoomFactor +1, so it can be skipped
	if (ZoomFactor == -2) DoZoom(1);
	else DoZoom(ZoomFactor + 1);
	return;
      }

    if (KeyEvent.GetKeyCode() == '&lt;')
      {
	// ZoomFactor -1 is essentially the same as ZoomFactor +1, so it can be skipped
	if (ZoomFactor == 1) DoZoom(-2);
	else DoZoom(ZoomFactor - 1);
	return;
      }

    if (KeyEvent.GetKeyCode() == '.')
      {
	DoZoom(1);
	return;
      }
    // if there was any other key pressed, we don't care and pass it through to the console
    // window
    wxGetApp().GetConsoleWin()-&gt;ProcessEvent(KeyEvent);
  }
...
</code></pre>
<p>und event.h:</p>
<pre><code class="language-cpp">...
class WXDLLIMPEXP_BASE wxEvtHandler : public wxObject
                                    , public wxTrackable
{
public:
    wxEvtHandler();
    virtual ~wxEvtHandler();

    // Event handler chain
    // -------------------

    wxEvtHandler *GetNextHandler() const { return m_nextHandler; }
    wxEvtHandler *GetPreviousHandler() const { return m_previousHandler; }
    virtual void SetNextHandler(wxEvtHandler *handler) { m_nextHandler = handler; }
    virtual void SetPreviousHandler(wxEvtHandler *handler) { m_previousHandler = handler; }

    void SetEvtHandlerEnabled(bool enabled) { m_enabled = enabled; }
    bool GetEvtHandlerEnabled() const { return m_enabled; }

    void Unlink();
    bool IsUnlinked() const;

    // Event queuing and processing
    // ----------------------------

    // Process an event right now: this can only be called from the main
    // thread, use QueueEvent() for scheduling the events for
    // processing from other threads.
    virtual bool ProcessEvent(wxEvent&amp; event);

    // Process an event by calling ProcessEvent and handling any exceptions
    // thrown by event handlers. It's mostly useful when processing wx events
    // when called from C code (e.g. in GTK+ callback) when the exception
    // wouldn't correctly propagate to wxEventLoop.
    bool SafelyProcessEvent(wxEvent&amp; event);
        // NOTE: uses ProcessEvent()
...
</code></pre>
<p>Denke, dass sich das schlecht überblicken lässt, aber evtl. habt jemand einfach einen Rat und das Problem liegt nicht tief vergraben. <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>
<p>MfG<br />
exbs</p>
]]></description><link>https://www.c-plusplus.net/forum/topic/280361/fehler-quot-is-inaccessible-within-this-context-quot</link><generator>RSS for Node</generator><lastBuildDate>Mon, 24 Aug 2026 04:04:37 GMT</lastBuildDate><atom:link href="https://www.c-plusplus.net/forum/topic/280361.rss" rel="self" type="application/rss+xml"/><pubDate>Fri, 14 Jan 2011 11:49:35 GMT</pubDate><ttl>60</ttl><item><title><![CDATA[Reply to Fehler: &amp;quot;is inaccessible ... within this context&amp;quot; on Fri, 14 Jan 2011 11:49:35 GMT]]></title><description><![CDATA[<p>Hallo Leute,</p>
<p>ich arbeite gerade mit einer nicht von mir geschriebenen Bibliothek und habe einige Probleme beim Kompilieren.</p>
<p>Mein System: Windows 7 64bit, minGW, WXWidgets 2.9.1</p>
<pre><code>g++ -I .  -DNOSCANFW -g -Wall  `wx-config --cxxflags` -fno-strict-aliasing -c vi
sual/ImageWindow.cpp -o some_machine/objvis/ImageWindow.o
C:/MinGW/include/wx-2.9/wx/event.h: In member function 'void ice::iceImageWindow::OnChar(wxKeyEvent&amp;)':
C:/MinGW/include/wx-2.9/wx/event.h:2997:18: error: 'virtual bool wxEvtHandler::ProcessEvent(wxEvent&amp;)' is inaccessible
visual/ImageWindow.cpp:266:54: error: within this context
</code></pre>
<p>Diese Fehlermeldung erhalte ich, wenn ich versuche ImageWindow.cpp zu kompilieren. Ich kann damit nicht viel anfangen. Wenn ich mir die Klasse anschaue, dann scheint dort alles korrekt.</p>
<p>Hier mal noch die ImageWindow.cpp:</p>
<pre><code class="language-cpp">...
void iceImageWindow::OnChar(wxKeyEvent&amp; KeyEvent)
  {
    // processes key events are: plus and minus key 
    // for zooming (the rest will do the scroll helper class for us)
    if (KeyEvent.GetKeyCode() == '&gt;')
      {
	// ZoomFactor -1 is essentially the same as ZoomFactor +1, so it can be skipped
	if (ZoomFactor == -2) DoZoom(1);
	else DoZoom(ZoomFactor + 1);
	return;
      }

    if (KeyEvent.GetKeyCode() == '&lt;')
      {
	// ZoomFactor -1 is essentially the same as ZoomFactor +1, so it can be skipped
	if (ZoomFactor == 1) DoZoom(-2);
	else DoZoom(ZoomFactor - 1);
	return;
      }

    if (KeyEvent.GetKeyCode() == '.')
      {
	DoZoom(1);
	return;
      }
    // if there was any other key pressed, we don't care and pass it through to the console
    // window
    wxGetApp().GetConsoleWin()-&gt;ProcessEvent(KeyEvent);
  }
...
</code></pre>
<p>und event.h:</p>
<pre><code class="language-cpp">...
class WXDLLIMPEXP_BASE wxEvtHandler : public wxObject
                                    , public wxTrackable
{
public:
    wxEvtHandler();
    virtual ~wxEvtHandler();

    // Event handler chain
    // -------------------

    wxEvtHandler *GetNextHandler() const { return m_nextHandler; }
    wxEvtHandler *GetPreviousHandler() const { return m_previousHandler; }
    virtual void SetNextHandler(wxEvtHandler *handler) { m_nextHandler = handler; }
    virtual void SetPreviousHandler(wxEvtHandler *handler) { m_previousHandler = handler; }

    void SetEvtHandlerEnabled(bool enabled) { m_enabled = enabled; }
    bool GetEvtHandlerEnabled() const { return m_enabled; }

    void Unlink();
    bool IsUnlinked() const;

    // Event queuing and processing
    // ----------------------------

    // Process an event right now: this can only be called from the main
    // thread, use QueueEvent() for scheduling the events for
    // processing from other threads.
    virtual bool ProcessEvent(wxEvent&amp; event);

    // Process an event by calling ProcessEvent and handling any exceptions
    // thrown by event handlers. It's mostly useful when processing wx events
    // when called from C code (e.g. in GTK+ callback) when the exception
    // wouldn't correctly propagate to wxEventLoop.
    bool SafelyProcessEvent(wxEvent&amp; event);
        // NOTE: uses ProcessEvent()
...
</code></pre>
<p>Denke, dass sich das schlecht überblicken lässt, aber evtl. habt jemand einfach einen Rat und das Problem liegt nicht tief vergraben. <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>
<p>MfG<br />
exbs</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2006500</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2006500</guid><dc:creator><![CDATA[EXBS]]></dc:creator><pubDate>Fri, 14 Jan 2011 11:49:35 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler: &amp;quot;is inaccessible ... within this context&amp;quot; on Fri, 14 Jan 2011 12:15:52 GMT]]></title><description><![CDATA[<p>Was für einen Typen gibt denn <code>wxGetApp().GetConsoleWin()</code> zurück?</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2006511</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2006511</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Fri, 14 Jan 2011 12:15:52 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler: &amp;quot;is inaccessible ... within this context&amp;quot; on Fri, 14 Jan 2011 12:45:08 GMT]]></title><description><![CDATA[<p>Wenn ich die Dokumentation und den Code richtig verstehe. Dann gibt dieser Befehl ein Pointer auf die Konsole zurück. Zuerst gibt wxGetApp() das &quot;aktuelle&quot; Programm, und das wiederum ist eine Konsole.</p>
<blockquote>
<p>//! Returns the pointer to the console window.</p>
</blockquote>
]]></description><link>https://www.c-plusplus.net/forum/post/2006525</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2006525</guid><dc:creator><![CDATA[EXBS]]></dc:creator><pubDate>Fri, 14 Jan 2011 12:45:08 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler: &amp;quot;is inaccessible ... within this context&amp;quot; on Fri, 14 Jan 2011 13:20:30 GMT]]></title><description><![CDATA[<p>EXBS schrieb:</p>
<blockquote>
<p>Wenn ich die Dokumentation und den Code richtig verstehe. Dann gibt dieser Befehl ein Pointer auf die Konsole zurück. Zuerst gibt wxGetApp() das &quot;aktuelle&quot; Programm, und das wiederum ist eine Konsole.</p>
<blockquote>
<p>//! Returns the pointer to the console window.</p>
</blockquote>
</blockquote>
<p>Ich meine nicht die Semantik des Objekts die zurückgegeben wird, sondern die exakte Syntax.</p>
<p>Semantik: Das was mit einem Ausdruck gemeint ist.<br />
Syntax: Die &quot;Grammatik&quot; eines Ausdrucks. Hier: Der Datentyp den der Compiler sieht.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2006545</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2006545</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Fri, 14 Jan 2011 13:20:30 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler: &amp;quot;is inaccessible ... within this context&amp;quot; on Fri, 14 Jan 2011 14:48:56 GMT]]></title><description><![CDATA[<p><code>getConsoleWin()</code> gibt einen Pointer auf ein <code>ConsoleWin</code> zurück. Dieses ist von <code>wxWindow</code> und <code>iceThreadCommHelper</code> abgeleitet.</p>
<p>Noch eine kleine Frage nebenbei...</p>
<pre><code class="language-cpp">class iceImageManager:private wxEvtHandler, private iceThreadCommHelper
</code></pre>
<p>Was bedeutet an dieser Stelle das <code>private</code> ? Sry, wenn ich blöde Fragen stelle, aber ich habe bisher fast nur mit Java programmiert und kenne mich in C++ nicht so gut aus.</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2006578</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2006578</guid><dc:creator><![CDATA[EXBS]]></dc:creator><pubDate>Fri, 14 Jan 2011 14:48:56 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler: &amp;quot;is inaccessible ... within this context&amp;quot; on Fri, 14 Jan 2011 14:58:24 GMT]]></title><description><![CDATA[<p>EXBS schrieb:</p>
<blockquote>
<p><code>getConsoleWin()</code> gibt einen Pointer auf ein <code>ConsoleWin</code> zurück. Dieses ist von <code>wxWindow</code> und <code>iceThreadCommHelper</code> abgeleitet.</p>
</blockquote>
<p>Und wie ist die letztendliche Beziehung zu wxEvtHandler?</p>
<blockquote>
<p>Noch eine kleine Frage nebenbei...</p>
<pre><code class="language-cpp">class iceImageManager:private wxEvtHandler, private iceThreadCommHelper
</code></pre>
<p>Was bedeutet an dieser Stelle das <code>private</code> ? Sry, wenn ich blöde Fragen stelle, aber ich habe bisher fast nur mit Java programmiert und kenne mich in C++ nicht so gut aus.</p>
</blockquote>
<p>Dies ist vermutlich der Grund für den Fehler:<br />
Ich kann es nicht in Java-Sprech ausdrücken, da es dort private-Vererbung nicht gibt. private-Vererbung ist eine &quot;hat ein&quot;-Beziehung zwischen Objekten. Ein bisschen mehr technischer Hintergrund ist hier:<br />
<a href="http://www.parashift.com/c++-faq-lite/private-inheritance.html" rel="nofollow">http://www.parashift.com/c++-faq-lite/private-inheritance.html</a><br />
Vermutlich ist da in dem Klassengeflecht die Methode die du aufrufen willst irgendwo private-vererbt und daher von ConsoleWin nicht aufrufbar.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2006589</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2006589</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Fri, 14 Jan 2011 14:58:24 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler: &amp;quot;is inaccessible ... within this context&amp;quot; on Fri, 14 Jan 2011 15:28:56 GMT]]></title><description><![CDATA[<p>SeppJ schrieb:</p>
<blockquote>
<p>Und wie ist die letztendliche Beziehung zu wxEvtHandler?</p>
</blockquote>
<p>Das habe ich noch nicht heraus gefunden. Ich habe mir die Klassenbeziehungen aufgezeichnet, aber es erben beide (sowohl <code>wxApp</code> , als auch ConsoleWin) nicht von <code>wxEvtHandler</code> . Oder (was wahrscheinlich ist) es mir nicht ersichtlich ;).</p>
<p>Es handelt sich hierbei um ein Projekt für die Uni. Ich kann leider erst am Montag meinen Ansprechpartner für diese Bibliothek erreichen. Mache mich dann wieder an die Arbeit und werde den Thread aktualisieren.</p>
<p>Verwunderlich ist, dass es mit wxWidgets Version 2.8.11 wunderbar geklappt hat (zumindest das Kompilieren). Dort gab es dann allerdings andere Fehler. Deshalb jetzt der Versuch mit der neueren Version.</p>
<p>Noch eine Frage. Was bedeutet das &quot; <code>-&gt;</code> &quot; ? Heißt es, dass ich auf eine Objektmethode zugreife ?</p>
<p>MfG</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2006599</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2006599</guid><dc:creator><![CDATA[EXBS]]></dc:creator><pubDate>Fri, 14 Jan 2011 15:28:56 GMT</pubDate></item><item><title><![CDATA[Reply to Fehler: &amp;quot;is inaccessible ... within this context&amp;quot; on Fri, 14 Jan 2011 15:31:27 GMT]]></title><description><![CDATA[<p>EXBS schrieb:</p>
<blockquote>
<p>Noch eine Frage. Was bedeutet das &quot; <code>-&gt;</code> &quot; ? Heißt es, dass ich auf eine Objektmethode zugreife ?</p>
</blockquote>
<p><code>p-&gt;foo();</code> ist Abkürzung für <code>(*p).foo();</code><br />
Das sind aber wichtigste Sprachgrundlagen.</p>
]]></description><link>https://www.c-plusplus.net/forum/post/2006602</link><guid isPermaLink="true">https://www.c-plusplus.net/forum/post/2006602</guid><dc:creator><![CDATA[SeppJ]]></dc:creator><pubDate>Fri, 14 Jan 2011 15:31:27 GMT</pubDate></item></channel></rss>