CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2

Thread: winsock version

  1. #1
    Join Date
    May 1999
    Posts
    34

    winsock version

    I want to know the windows' winsock version, 1.1 or 2.0. Which API can I use?


  2. #2
    Join Date
    May 1999
    Location
    Uppsala Sweden
    Posts
    3

    Re: winsock version

    You can tell by using WSAStartup. Since you are asking for a specific version, you can ask for version 2.0. You must check the result and make sure there is no error. In case of an incorrect version you will get "WSAVERNOTSUPPORTED". You get the current version in the WSAData.
    Example:
    result = WSAStartup(ver,&WSAData);
    if ( result!=0 )
    if ( result == WSAVERNOTSUPPORTED ) {
    // failed due to incorrect version.
    // WSAData.wVersion contains the version using LO/HI WORD.
    }


    bye,
    Amir.



Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured