I am having a problem with winsock in my app, I can connect to the sever when I test it using my demo but when I use the actual application it wont connect. Below is the code I am using to connect to the server:
VB Code:
Private Sub Command2_Click() messcon.Connect txtConnect, 7000 If messcon.State = sckConnected Then Command2.Enabled = False Else MsgBox (LoadResString(68 + i)) End If End Sub
I keep getting the please connect message showing up. It worked find before I added this code:
VB Code:
Private Sub Command3_Click() If Not txtAttachment.Text = "" Then NF = FreeFile Open cmdAttach.FileName For Input As #NF Input #NF, data fname = cmdAttach.FileTitle messcon.SendData "|DATA|" & data & fname Close #NF End If End Sub Private Sub Messlis_DataArrival(Index As Integer, ByVal bytesTotal As Long) If InStr(1, str, "|DATA|") <> 0 Then NF = FreeFile MkDir (App.Path & "\Received Files\") Open App.Path & "\Received Files\" & fname For Output As #NF Print #NF, data Close #NF End If End Sub
TIA
Nightwalker83




Reply With Quote