奇怪的错误 c2660“函数不接受 1 个参数”
我的基类有这个函数
LRESULT CBaseClass::OnTestFunction(WPARAM id, LPARAM=0)
{
...
}
当派生类调用这个函数时,
OnTestFunction(nId);
我收到错误 C2660:“函数不接受 1 个参数”。
这是为什么 ?
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 ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
您需要将默认值放在头文件中的类定义中。
You need to put the default value in the class definition in the header file.
默认值应该在类定义中:
以便派生类可以看到该签名和默认值。
The default value should be in the class definition:
so that the derived class can see that signature and the default value.
签名中不应该有参数名称吗?喜欢:
Shouldn't be there a name of the parameter in the signature? Like: