471,596 Members | 818 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,596 software developers and data experts.

Reflection and base class method calls...


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
0 808

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Dave Clarke | last post: by
3 posts views Thread by frankgerlach | last post: by
2 posts views Thread by Luis Arvayo | last post: by
2 posts views Thread by Wiktor Zychla [C# MVP] | last post: by
2 posts views Thread by =?Utf-8?B?UmVuYXVkIExhbmdpcw==?= | last post: by
reply views Thread by Anwar ali | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.