Solved

Builder:I can't dinamically load winsock.dll

Posted on 1998-03-05
9
368 Views
Last Modified: 2008-02-01
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!



DllInstance=LoadLibrary("WINSOCK.DLL");
0
Comment
Question by:ineila
9 Comments
 
LVL 22

Expert Comment

by:nietod
Comment Utility
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()?
0
 

Author Comment

by:ineila
Comment Utility
Edited text of question
0
 
LVL 23

Accepted Solution

by:
chensu earned 30 total points
Comment Utility
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.
0
 

Author Comment

by:ineila
Comment Utility
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?


0
How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

 
LVL 23

Expert Comment

by:chensu
Comment Utility
After which function, GetLastError returns 120?
0
 

Author Comment

by:ineila
Comment Utility
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. ??

0
 
LVL 23

Expert Comment

by:chensu
Comment Utility
I tried it on my Windows 95. LoadLibrary("wsock32.dll") succeeded and returned a non-NULL handle. Check your system.
0
 

Author Comment

by:ineila
Comment Utility
Ok. I checked my system.. but my error was that i didn't initialize the windows sockets
subsystem, with WSAStartup()!

Thank you.


0
 

Expert Comment

by:socketman
Comment Utility
You would save yourself a lot of trouble if you just go and get a commercial Winsock VCL.

I use IP*Works! from http://www.dev-soft.com/  -  it's native VCLs, and they have a free trial.
0

Featured Post

What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

Join & Write a Comment

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
What is C++ STL?: STL stands for Standard Template Library and is a part of standard C++ libraries. It contains many useful data structures (containers) and algorithms, which can spare you a lot of the time. Today we will look at the STL Vector. …
The viewer will learn additional member functions of the vector class. Specifically, the capacity and swap member functions will be introduced.
The viewer will learn how to clear a vector as well as how to detect empty vectors in C++.

728 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now