|
-
November 27th, 2002, 11:32 PM
#1
Why can't I create CSocket derived socket?
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
-
November 28th, 2002, 12:43 AM
#2
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.
-
November 28th, 2002, 08:39 AM
#3
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.
Regards
Robert Thompson
-
November 28th, 2002, 07:30 PM
#4
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.
-
November 30th, 2002, 10:53 AM
#5
I got it, thx everyone
-
December 2nd, 2002, 06:20 PM
#6
Exactlt where in the application do you put that code - AfxSocketInit()?
-
December 2nd, 2002, 07:17 PM
#7
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|