sebob
Jun 24th, 1999, 05:39 PM
Hello, I've wriiten a chat program, it's fully functional but it's tough to tell if someone on the other end is there. An example would be me trying to connect to my friend each time just to see if he's there. So I want to broadcast a message out each time I click on a button and when the form first loads. Here's what I have so far:
Dim LIP As String
Private Sub Form_Load()
LIP = Winsock1.LocalIP
**Here's where I want to broadcast the message
End Sub
There's more to it, it's just irrelevant.
I also have a winsock.bas which someone's created which seems to have all the Functions and constants defined Ver. 1.1 I believe, it's a port from the winsock document based on C. In it is this:
Public Const XP1_SUPPORT_BROADCAST& = &H200&
Public Const SIO_GET_BROADCAST_ADDRESS = (IOC_VOID Or IOC_WS2 Or 5)
Public Const SO_BROADCAST% = &H20
Public Const INADDR_BROADCAST& = &HFFFF
Declare Function send% Lib "wsock32.dll" Alias "#19" (ByVal s&, ByRef buf$, ByVal buflen%, ByVal flags%)
Declare Function sendto% Lib "wsock32.dll" Alias "#20" (ByVal s&, ByRef buf&, ByVal buflen%, ByVal flags%, ByRef toaddr As sockaddr, ByRef tolen%)
As well as eeverything else about Winsock. I'm not quite sure how to Implement this, I'm
very new to VB. Any and all help would be appreciated, thanks.
P.S. If anyone would like a copy of the Winsock.bas, give me an e-mail.
Dim LIP As String
Private Sub Form_Load()
LIP = Winsock1.LocalIP
**Here's where I want to broadcast the message
End Sub
There's more to it, it's just irrelevant.
I also have a winsock.bas which someone's created which seems to have all the Functions and constants defined Ver. 1.1 I believe, it's a port from the winsock document based on C. In it is this:
Public Const XP1_SUPPORT_BROADCAST& = &H200&
Public Const SIO_GET_BROADCAST_ADDRESS = (IOC_VOID Or IOC_WS2 Or 5)
Public Const SO_BROADCAST% = &H20
Public Const INADDR_BROADCAST& = &HFFFF
Declare Function send% Lib "wsock32.dll" Alias "#19" (ByVal s&, ByRef buf$, ByVal buflen%, ByVal flags%)
Declare Function sendto% Lib "wsock32.dll" Alias "#20" (ByVal s&, ByRef buf&, ByVal buflen%, ByVal flags%, ByRef toaddr As sockaddr, ByRef tolen%)
As well as eeverything else about Winsock. I'm not quite sure how to Implement this, I'm
very new to VB. Any and all help would be appreciated, thanks.
P.S. If anyone would like a copy of the Winsock.bas, give me an e-mail.