Re: socket creation failing in XP
Well I am not using any of the MFC socket classes, rather I am using Winsock
API calls,
It is a mix and match as you see below,
// initialize the TCP/IP support
if (!AfxSocketInit())
{
//AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
ShowError(IDP_SOCKETS_INIT_FAILED);
return FALSE;
}
// need to create a socket
m_pSocket = m_nType == ETHERNET_TYPE_TCP ?
socket(PF_INET, SOCK_STREAM, IPPROTO_TCP) :
socket(PF_INET, SOCK_DGRAM, IPPROTO_UDP);
if (m_pSocket == INVALID_SOCKET)
{
ConnectDisplay(pDialog, _T("ERROR: Unable to creating
TCP/IP socket...\r\n"));
return (0);
}
The execution entered the above 'if' loop as the socket() call failed.
Please help.
"Joseph M. Newcomer" wrote:
OK, you gave a lot of information about the OS etc. but not a single bit of information
about what you were trying to do when the error occurred, other than the rather
meaningless "socket creation failed". But you seem to distinguish "socket initialization"
from "socket creation". The correct error report might say, "AfxSocketInit worked fine,
but CAsyncSocket::Create(--your parameters here---) failed".
How can we diagnose a problem with so little information? You don't say anything about
the context in which it is running, for example.
A few minutes of research on google for WSAEPROVIDERFAILEDINIT states that this will fail
if the current environment does not define SYSTEMROOT. But since you didn't tell us
anything about the context in which you are running, there is no way to figure out if this
could be related to your program or not.
joe
On Thu, 27 Apr 2006 05:05:02 -0700, sivakumaran <sivakumaran@discussions.microsoft.com>
wrote:
I am running a software built for windows in a Dell PC running XP with SP2.0
(I used VC6.0 to build the software)
My software attempts to connect to a device over ethernet.
My socket initialization went fine. Socket creation failed with an error as
follows,
10106 - The requested service provider could not be loaded or initialized.
Well, the software is running fine on Win 2K and NT as well.
Why is it so?
Joseph M. Newcomer [MVP]
email: newcomer@flounder.com
Web: http://www.flounder.com
MVP Tips: http://www.flounder.com/mvp_tips.htm
--
NewsGuy.Com 30Gb $9.95 Carry Forward and On Demand Bandwidth