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);
}
}
On line return CPMSifDlg::EncodeAndSend
I have an error :
Error : a nonstatic member reference must be relative to a specific object.
What does it mean?
EncodeAndSend
is not a static function, which means it can be called on an instance of the classCPMSifDlg
. You cannot write this:It should rather be called as:
Only static functions are called with class name.
Non static functions have to be called using objects.
This is exactly what your error means. Since your function is non static you have to use a object reference to invoke it.
CPMSifDlg::EncodeAndSend()
method is declared as non-static
and thus it must be called using an object ofCPMSifDlg
. e.g.If
EncodeAndSend
doesn't use/relate any specifics of an object (i.e.this
) but general for theclass CPMSifDlg
then declare it asstatic
: