Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » U++ Callbacks and Timers » THISBACK and inheritance
Re: THISBACK and inheritance [message #48482 is a reply to message #48481] Thu, 06 July 2017 22:41 Go to previous messageGo to previous message
rafiwui is currently offline  rafiwui
Messages: 105
Registered: June 2017
Location: Stuttgart, Germany
Experienced Member
Oblivion wrote on Thu, 06 July 2017 20:25


As far as I can see, you are calling a pure virtual method (or storing its address -which is undefined at that moment) from base constructor.
Calling a pure virtual method from base constructor is undefined behaviour. (Since at that point the vtable entry for the said method is not yet assigned. It is basically "0" (undefined)). That's why you dont't even get an explicit error message.



But why is it working for the OnClickButton callbacks in the FnWindow?


Oblivion wrote on Thu, 06 July 2017 20:25


Also I see that you use some obscure internal macro(s) explicitly. You dont need them at all.



What macros do you mean and how can I avoid them?

Thanks,
Daniel


Greetings
Daniel
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: About storing references and pointers to callbacks.
Next Topic: [REQUEST]: Allow callback() template to work also with non-void and non-bool return types.
Goto Forum:
  


Current Time: Sun Apr 28 11:25:29 CEST 2024

Total time taken to generate the page: 0.05514 seconds