Solved

Builder:I can't dinamically load winsock.dll

Posted on 1998-03-05
9
384 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
ID: 1183068
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
ID: 1183069
Edited text of question
0
 
LVL 23

Accepted Solution

by:
chensu earned 30 total points
ID: 1183070
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
Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 

Author Comment

by:ineila
ID: 1183071
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
 
LVL 23

Expert Comment

by:chensu
ID: 1183072
After which function, GetLastError returns 120?
0
 

Author Comment

by:ineila
ID: 1183073
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
ID: 1183074
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
ID: 1183075
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
ID: 3179996
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

Free Tool: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Handle Exceptions during instantiation 28 423
IdTCPClient1->Disconnect(); not working 3 77
C++ to C# code conversion issue 4 112
No module found pypyodbc, 3 33
Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
The viewer will learn how to user default arguments when defining functions. This method of defining functions will be contrasted with the non-default-argument of defining functions.
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.

837 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