Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Winsock Control

Status
Not open for further replies.

seyed

Programmer
Mar 16, 1999
9
GB
Hi,<br>
<br>
Can the winsock control be used in a Class module? If not, can I still (somehow) use it in an ActiveX DLL? And if not can someone tell me where / how / what I can use to make TCP/IP connections to a server from an ActiveX DLL.<br>
<br>
TIA.<br>
<br>
Seyed.
 
Seyed,<br>
<br>
I've never done this - so I'm guessing really - but bear with me.<br>
<br>
Start a new project - an activex dll project<br>
<br>
from the project menu - choose components, uncheck &quot;Selected Items Only&quot; and include the Microsoft Winsock control.<br>
<br>
You can then write code like this:<br>
<br>
--snip--<br>
Option Explicit<br>
<br>
Dim w As Winsock<br>
<br>
Private Sub Class_Initialize()<br>
w.Accept<br>
End Sub<br>
--snip--<br>
<br>
Will it work? Don't know - but it's worth a go.<br>
<br>
Mike<br>
<br>
<p>Mike Lacey<br><a href=mailto:Mike_Lacey@Cargill.Com>Mike_Lacey@Cargill.Com</a><br><a href= Cargill's Corporate Web Site</a><br>
 
Hi,<br>
<br>
No this doesn't work. The MS Winsock control cannot be used like this.<br>
<br>
To confirm try it and you get errors about the object no being initialised when trying to access its methods/properties.<br>
<br>
However, I have a Class module that does this now and I'll mail to anyone who asks. <br>
<br>
<A HREF="mailto:seyed@mailandnews.com">seyed@mailandnews.com</A>.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top