CAsyncSocket create failed to create socket

Solution:

Add the following code to the constructor of the subclass that inherits the CAsyncSocket class:

1 if (!AfxSocketInit())
2     AfxMessageBox(IDP_SOCKETS_INIT_FAILED);

In addition, select "Windows Sockets" when creating the dialog item , otherwise IDP_SOCKETS_INIT_FAILED will report an error.

If the C***App class inherits the CAsyncSocket class, add the above code to the initialization function InitInstance() .

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324646957&siteId=291194637