Socket 学习2

来源:互联网 发布:搜狐网络大厦11层 编辑:程序博客网 时间:2024/06/07 15:44

1.1      AfxSocketInit()

// 它在幕后替我做了什么?

Call this function in yourCWinApp::InitInstance override to initialize Windows Sockets.

BOOL AfxSocketInit(
   WSADATA* lpwsaData = NULL 
);

 Parameters

lpwsaData

A pointer to a WSADATA structure. If lpwsaData is not equal to NULL, then the addressof the WSADATA structure is filled by the call to WSAStartup.This function also ensures that WSACleanup is called for you before theapplication terminates.

Return Value

Nonzero if the function is successful; otherwise 0.

原创粉丝点击