By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
455,573 Members | 1,924 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 455,573 IT Pros & Developers. It's quick & easy.

Reflection and base class method calls...

P: n/a
mel
Hi,

If I have an object 'mySuperClass' of type 'CSuperClass', which is derived
from 'CBaseClass', and 'mySuperClass' overrides method 'SomeMethod' of
'CBaseClass', is it possible to to use reflectiion to invoke 'SomeMethod'
on 'mySuperClass' is such a way as to have the base class implementation of
'SomeMethod' be called?

The only way I have been able to make this work is by shadowing method
'SomeMethod' in the derived class instead of overriding it, and shadowing is
a bad thing to do in the context of my project (for reasons too complicated
to explain here). I tried to use MethodInfo.GetBaseDefinition, but for
virtual methods, this call simply returns a reference to the virtual
(overridden) method, and I want a reference to the base method.

Any insight would be greatly appreciated...

Nov 21 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.