Reflection and base class method calls...

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • mel

    #1

    Reflection and base class method calls...

    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.GetB aseDefinition, 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...



Working...