什么是“错误:非静态成员引用必须相对于特定对象”?意思? [英] what does "error : a nonstatic member reference must be relative to a specific object" mean?
本文介绍了什么是“错误:非静态成员引用必须相对于特定对象”?意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
int CPMSifDlg::EncodeAndSend(char *firstName, char *lastName, char *roomNumber, char *userId, char *userFirstName, char *userLastName)
{
...
return 1;
}
extern "C"
{
__declspec(dllexport) int start(char *firstName, char *lastName, char *roomNumber, char *userId, char *userFirstName, char *userLastName)
{
return CPMSifDlg::EncodeAndSend(firstName, lastName, roomNumber, userId, userFirstName, userLastName);
}
}
行返回CPMSifDlg: :EncodeAndSend
我有一个错误:
错误:非静态成员引用必须相对于特定对象。
On line return CPMSifDlg::EncodeAndSend
I have an error :
Error : a nonstatic member reference must be relative to a specific object.
它是做什么的
推荐答案
EncodeAndSend
不是静态函数,这意味着它可以在类 CPMSifDlg
的实例上调用。您不能这样写:
EncodeAndSend
is not a static function, which means it can be called on an instance of the class CPMSifDlg
. You cannot write this:
CPMSifDlg::EncodeAndSend(/*...*/); //wrong - EncodeAndSend is not static
它应该被称为:
CPMSifDlg dlg; //create instance, assuming it has default constructor!
dlg.EncodeAndSend(/*...*/); //correct
这篇关于什么是“错误:非静态成员引用必须相对于特定对象”?意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文