if (ConnectSocket = socket(servinfo->ai_family, servinfo->ai_socktype, servinfo->ai_protocol) == INVALID_SOCKET)
You´re comparing socket(...) to INVALID_SOCKET
and then you´re assigning the result true/false to ConnectSocket.
Use
if ((ConnectSocket = socket(servinfo->ai_family, servinfo->ai_socktype, servinfo->ai_protocol)) == INVALID_SOCKET)
See lists of C++ operator precedence