Discussion Locked

Winsock in VB

0 helpful
3 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

Hi,

Im developing an application and I need to create a winsock client. The server has been supplied. I then need to message the server. I know I can use the winsock control but I am wondering how to use a reference to winsock if I'm building a COM object for a website that has no graphical interface other than the front end website.

How can I create a reference to winsock to access its API?

PS U can email on jantkea@progressivebiz.com

Cheers
Andrew

3 replies

by gbworld

You do not want to use Winsock here. You have a couple of options, however. The easiest to program is the XMLHTTP Request object in the MSXML DOM. I know this seems odd if you are not using XML, but it works for non XML pages also. The downside is proxy servers mess this up. Supposedly this is fixed in version 3.0, but I have not tested it.

The other way is to use WinInet. You will have to get the syntax for WinInet from MSDN. This is a bit harder to program, but is the same API the Winsock control uses. There are some sample apps on www.vbcode.com. You can find others with an easy search on the web.

If you need some quick code, I have a mod of WinInet calls. It was proof-of-concept, so you will have to clean it up.

Gregory A. Beamer
MCP: +I, SE, SD, DBA

by jantkea

Thanks for your help. You seem to know your stuff but I need some more help via email here are the points.

This discussion is closed to new replies.