m_pSocket = new CListeningSocket(this);
if( m_pSocket->Create(SOCKET_PORT) )
...
an error "10093" is got. Can anybody tell me what does that mean? thx
Printable View
m_pSocket = new CListeningSocket(this);
if( m_pSocket->Create(SOCKET_PORT) )
...
an error "10093" is got. Can anybody tell me what does that mean? thx
I did a lookup and found that the code error means "Either the application has not called WSAStartup, or WSAStartup failed. "
If you are using MFC, it is very likely that you didn't call AfxOleInit() in CWinApp::InitInstance().
Hope that helps.
I don't know if AfxOleInit includes WSAStartup. WSAStartup(...) is a routine that loads the WinSock dll, and must be called before you do anything else in WinSock.
Oh no, I am very sorry.:( I had made an mistake and function I meant should be AfxSocketInit(). This function will call WSAStartup() and ensure that WSACleanup() is called before the program terminates.
Should be more carefull next time.:)
I got it, thx everyone:)
Exactlt where in the application do you put that code - AfxSocketInit()?
InitInstance()