Followup: Weakref - details

ATS asteinarson at gmail.com
Sun Feb 10 12:18:45 PST 2008


> 
> > A> >  From eVC help file it does support these options and it also supports
> > A> > #pragma pointers_to_members(multiple_inheritance) and
> > A> > __multiple_inheritance keyword.
> > A> 
> >
> Maybe it's possible and worth a try. But we have wxEvtHandler member:
> 
> ...
> 
> It seems the #pragmas would do the same job as the compiler options. 
> Better than updating the project files? Probably so since we depend
> on it. 
> 

I tested the #pramga approach on Windows (VC++ 8.0)and it works. I had
ro rebuild WX of course and all libraries using it. 

The solution has two steps: 


1 - Very early in the #include phase:
(For me it wasn't enough to put it in event.h, but that's maybe 
because I had precompiled stuff around still. Does it belong in 
defs.h or platform.h?)

  #if defined(__WXMSW__) && defined(__WXWINCE__)
	// Member function pointers that handle multiple inheritance 
	#pragma pointers_to_members(full_generality,multiple_inheritance)
  #endif 


2 - In event.h:

  #if !defined(__WXWINCE__) 
	// Comment...
	typedef void (wxEvtHandler::*wxEventFunction)(wxEvent&);	
  #else
        // Comment...
	typedef void (wxObject::*wxEventFunction)(wxEvent&);	
	typedef  wxEventFunction;
  #endif 
  
And after that, replace wxObjectEventFunction with wxEventFunction.

That should give us something working, event for ARM and eVC.


Regards
// ATS.







More information about the wx-dev mailing list