AddPendingEvent() is inaccessible Topic is solved

If you are using the main C++ distribution of wxWidgets, Feel free to ask any question related to wxWidgets development here. This means questions regarding to C++ and wxWidgets, not compile problems.
Post Reply
Ultimate wxWidgets Guru
Ultimate wxWidgets Guru
Posts: 543
Joined: Wed Apr 05, 2006 9:39 am

AddPendingEvent() is inaccessible

Post by MoonKid » Tue Feb 10, 2009 7:56 pm

After updating my SVN yesterday (it was few month old) I got a error message from my compiler I have never read before.

Code: Select all

mingw32-g++.exe -Wall -DwxUSE_UNICODE  -g -D_DEBUG -D__WXDEBUG__ -DWXUSINGDLL -DWIN32 -D__WXMSW__ -D_WINDOWS -DNOPCH  -Wall   -IC:\wxWidgets\include -Ithird-party\wxSerialize\include\wx -Iinclude -IC:\MinGW\include  -c D:\Garage\projekte\blackfisk\trunk\src\BFMsgObserver.cpp -o .out\objs_debd\src\BFMsgObserver.o
D:\Garage\projekte\blackfisk\trunk\src\BFMsgObserver.cpp: In member function `virtual void BFMsgObserver::ValueChanged(Subject*)':
C:/wxWidgets/include/wx/event.h:2895: error: `virtual void wxEvtHandler::AddPendingEvent(const wxEvent&)' is inaccessible
D:\Garage\projekte\blackfisk\trunk\src\BFMsgObserver.cpp:97: error: within this context
Process terminated with status 1 (0 minutes, 4 seconds)
2 errors, 0 warnings
I don't know what "inaccessible" mean in that context. My compiler never used this word before. ;)

The "context" is

Code: Select all

            // message type
            event.SetExtraLong  (pSys->GetLastType());
            // the question
            event.SetString     (strMsg);
            // send event
            // want for answer from main-thread/user
            // get the answer
            stop = BFThread_BackupRunner::CurrentlyRunning()->GetUsersStopAnswer();
But I don't know if it helps.

This is the non-public-missing(!) definition of the class

Code: Select all

class BFBackupProgressDlg : public wxDialog
  // ....
Any idea what happened here?

Site Admin
Site Admin
Posts: 3881
Joined: Thu Jan 12, 2006 6:23 pm
Location: IoW, UK

Post by DavidHart » Tue Feb 10, 2009 9:12 pm


There have been various changes recently in the event code. One of these was to make wxEvtHandler::AddPendingEvent and wxEvtHandler::ProcessEvent private. Why? Because (according to VZ) if you call them direct, the default handler is called, ignoring any others that may have been pushed. Instead you should access them via wxWindow::GetEventHandler.

So your code should be changed to:



Post Reply