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);
    }
}

在线的return CPMSifDlg::EncodeAndSend我有一个错误:错误:非静态成员参考必须相对于特定对象。

这是什么意思?

答案

EncodeAndSend不是静态功能,这意味着可以在类的实例上调用CPMSifDlg。你不能写这一点:

 CPMSifDlg::EncodeAndSend(/*...*/);  //wrong - EncodeAndSend is not static

应该称其为:

 CPMSifDlg dlg; //create instance, assuming it has default constructor!
 dlg.EncodeAndSend(/*...*/);   //correct 

来自: stackoverflow.com