How to prevent derived class clts from using base class fxn
I have a base and derived class, as follows:
class BaseClass
{
public BaseClass(string str){ ... do stuff with str ...};
};
class DerivedClass : BaseClass
{
public Foo(string str, IntPtr ptr) { ... do stuff with str and ptr ....}
};
// Other classes can derive from BaseClass ....
Client code looks like this:
DerivedClass dc = new DerivedClass();
dc.Foo("Hello"); // <--- note no IntPtr being passed.
In these cases, the base class function is being called.
What I want is a compile time error.
How to get one?