我創建了Windows窗體應用程序,我有這個代碼的問題有人可以幫助我嗎?感謝幫助。函數調用缺少參數列表錯誤(C++)
void thListen(void* Args)
{
const char* chIp;
long answer;
WSAData wsaData;
WORD DLLVERSION;
DLLVERSION = MAKEWORD(2,1);
answer = WSAStartup(DLLVERSION, &wsaData); // odpowiadanie za uzywanie wersji winsocket
SOCKADDR_IN addr; // deklarowanie obiekut
int addrlen = sizeof(addr);
SOCKET sListen;
SOCKET sConnect;
sConnect = socket(AF_INET, SOCK_STREAM, NULL);
chIp = (const char*)(void*) Marshal::StringToHGlobalAnsi(textBox1->Text);
addr.sin_addr.s_addr = inet_addr(chIp);
addr.sin_family = AF_INET;
addr.sin_port = htons(1234);
sListen = socket(AF_INET,SOCK_STREAM, NULL);
bind(sListen, (SOCKADDR*)&addr, sizeof(addr));
listen(sListen, SOMAXCONN);
for(;;)
{
if(sConnect = accept(sListen, (SOCKADDR*)&addr, &addrlen))
{
answer = send(sConnect, "Wiadomosc",10 , NULL);
}
}
_endthread();
}
private: System::Void button1_Click(System::Object^ sender, System::EventArgs^ e) {
_beginthread(this->thListen, 0, NULL);
}
};
}
問題是this->thListen
和錯誤是Error 1 error C3867: 'WinSockCommunicationApplication::Form1::thListen': function call missing argument list; use '&WinSockCommunicationApplication::Form1::thListen' to create a pointer to member c:\users\bartek\documents\visual studio 2010\projects\winsockcommunicationapplication\winsockcommunicationapplication\Form1.h 139 1 WinSockCommunicationApplication (Visual Studio 2010)
我可以把有()我768,16辦?
我的意思是,真的。這個錯誤以簡單的英文表達出來。它不能做得更好。 – chris