Builder:I can't dinamically load winsock.dll

I'm trying to implement a tcpip cliente with winsock.dll, because i need binary comunication
with a server. But  the LoadLibrary("winsock.dll") fails.

How can i load the library?
i tried with others, "twain.dll" fails too, but "NViewlib.dll" works fine.

Sorry, I haven't explain it enought,
The library winsock.dll is in the windows directory, and the error that returns
GetLastError is number 31. It says that a device in the system does'n works ??
I have the TCP/IP installed, and it works!

Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Where is winsock.dl?  You must specify a path to it or it must be in the windows directory or in the dirrectory with your app.

What is the error code returned by GetLastError()?
ineilaAuthor Commented:
Edited text of question
Use Wsock32.dll instead. Winsock.dll seems to be used by 16-bit applications running on 32-bit Windows even though it is a 32-bit dll.

By the way, twain.dll is definitely 16-bit while twain_32.dll is 32-bit.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
HTML5 and CSS3 Fundamentals

Build a website from the ground up by first learning the fundamentals of HTML5 and CSS3, the two popular programming languages used to present content online. HTML deals with fonts, colors, graphics, and hyperlinks, while CSS describes how HTML elements are to be displayed.

ineilaAuthor Commented:
It seems to works fine in my windows NT, but GetLastError returns 120 in my
Windows 95, it says the function only works in Win32 ?? It isn't an error not?

After which function, GetLastError returns 120?
ineilaAuthor Commented:
After function LoadLibrary("wsock32.dll").
And, working with my NT, when i try to import function socket, it says denied access.
With the function connect, recv, etc, it says can't find resource. ??

I tried it on my Windows 95. LoadLibrary("wsock32.dll") succeeded and returned a non-NULL handle. Check your system.
ineilaAuthor Commented:
Ok. I checked my system.. but my error was that i didn't initialize the windows sockets
subsystem, with WSAStartup()!

Thank you.

You would save yourself a lot of trouble if you just go and get a commercial Winsock VCL.

I use IP*Works! from  -  it's native VCLs, and they have a free trial.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.