winsock.dll ,wsock32.lib and Ws2_32.lib

winsock.dll ,wsock32.lib and Ws2_32.lib

Post by john_g12.. » Fri, 29 Dec 2000 13:32:56



i have recently started working with winsock and till now the
FAQ and quin's book have really helped me out.

i need a few clarifications though.

i have vc compiler with me and have been able to get simple
programs like getting IP address of local box fine.
however i found that i had two lib files related to winsock
that are needed while compiling.
     "Ws2_32.lib or wsock32.lib"

i have been going through the archives and faq and some say
to include Ws2_32.lib and others (including faq) wsock32.lib

which one is the right one. (program compiles fine with wsock32.lib)

Second question: what is role of winsock.dll
the file indicates that it is a
"16-bit Windows Sockets API for Windows NT" version 3.10

what exactly does this dll do ? i have compiled and exe that
can get the IP address of the local host fine. does this exe
need to access the dll ? actually i deleted (renamed) this dll
and still my exe could run and execute just fine.

Sent via Deja.com
http://www.deja.com/

 
 
 

winsock.dll ,wsock32.lib and Ws2_32.lib

Post by Alun Jon » Fri, 29 Dec 2000 23:49:51



> i have been going through the archives and faq and some say
> to include Ws2_32.lib and others (including faq) wsock32.lib

> which one is the right one. (program compiles fine with wsock32.lib)

WS2_32 is for Winsock 2.x applications, and WSOCK32 is for Winsock 1.x apps.
 If you're including winsock.h, then you should bind to WSOCK32, and call
WSAStartup with a version required of MAKEWORD(1,1).  If you include
winsock2.h, then you should bind to WS2_32, and your required version
parameter should be MAKEWORD(2,0).

Quote:> Second question: what is role of winsock.dll
> the file indicates that it is a
> "16-bit Windows Sockets API for Windows NT" version 3.10

> what exactly does this dll do ? i have compiled and exe that
> can get the IP address of the local host fine. does this exe
> need to access the dll ? actually i deleted (renamed) this dll
> and still my exe could run and execute just fine.

This is for 16-bit programs - programs written for Windows 3.1 - to work on
your system.  If you are developing for Windows 95, 98, ME, NT or 2000, you
should be developing 32-bit programs, so you won't need to deal with
winsock.dll.

Alun.
~~~~

[Note that answers to questions in newsgroups are not generally
invitations to contact me personally for help in the future.]
--
Texas Imperial Software   | Try WFTPD, the Windows FTP Server. Find us at

Cedar Park TX 78613-1419  | VISA/MC accepted.  NT-based sites, be sure to
Fax/Voice +1(512)378-3246 | read details of WFTPD Pro for NT.