Changing the behaviour of persistent objects

Dear ROOTers,

suppose there is an object of type A in a file and a class B inheriting from A. After reading the object from the file I want to cast it in type B so that all MENU functions, TOGGLES and things like ExecuteEvent() etc. defined in class B are working for the converted object. How can I achieve this? A simple typecast does not work. I guess the tiny difference between ClassName() and Class()->GetName() is important.

Many thanks,
Oliver