My base class has this function
LRESULT CBaseClass::OnTestFunction(WPARAM id, LPARAM=0)
{
...
}
When the derived class calls this function
OnTestFunction(nId);
I get an error C2660 : "function does not take 1 arguments".
Why is that ?
You need to put the default value in the class definition in the header file.
class CBaseClass {
....
LRESULT OnTestFunction(WPARAM id, LPARAM=0);
....
};
The default value should be in the class definition:
class CBaseClass {
LRESULT OnTestFunction(WPARAM id, LPARAM=0);
};
so that the derived class can see that signature and the default value.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With