J
Jon Davis
If I have a class with a virtual method, and a child class that overrides
the virtual method, and then I create an instance of the child class AS A
base class...
BaseClass bc = new ChildClass();
.... and then call the virtual method, why is it that the base class's method
is called instead of the overridden method? How do I fix this if I don't
know at runtime what the child class is? I'm using
Activator.CreateInstance() to load the child class from a satellite DLL, a
third-party plug-in that inherits my base class, so I therefore cannot
declare the child class type in the code or at compile time.
Thanks,
Jon
the virtual method, and then I create an instance of the child class AS A
base class...
BaseClass bc = new ChildClass();
.... and then call the virtual method, why is it that the base class's method
is called instead of the overridden method? How do I fix this if I don't
know at runtime what the child class is? I'm using
Activator.CreateInstance() to load the child class from a satellite DLL, a
third-party plug-in that inherits my base class, so I therefore cannot
declare the child class type in the code or at compile time.
Thanks,
Jon