Hi. I have made an program with a winsock control. A chat program. Then if the winsock isint connected and you try to send something comes an error. When I put in on error goto Handler and write the 'Handler', it goes through even without a error.
Help...
And another question.
When I save my project and press the button, make NameOfFile.exe there comes up an error: Permission denied to "C\Location\". This happends sometimes, not allways. Whats the problem?
When I save my project and press the button, make NameOfFile.exe there comes up an error: Permission denied to "C\Location\". This happends sometimes, not allways. Whats the problem?
I guess I can help here
Before trying to compile ( MAke EXE ), make sure al the processes of your app has been destroyed. Meaning, make sure your program exits correctly. If you still have running processes of your program, while trying to make the exe again, you will get errors.
This is a public forum, where all of us must share with each other.
If you don't want everyone to see your code, fine that is your perogative, but you have to understand, that, without your code we cannot help you - do you understand that ¿
We are all helping voluntary, we don't get anything except the satisfaction of helping others like you.
Again, if you want us to help you, give the code so that we can help you.
This is a public forum, where all of us must share with each other.
If you don't want everyone to see your code, fine that is your perogative, but you have to understand, that, without your code we cannot help you - do you understand that ¿
We are all helping voluntary, we don't get anything except the satisfaction of helping others like you.
Again, if you want us to help you, give the code so that we can help you.
Take it, or leave it!
Can I only post the part of code where I need help?
*****
' Error code:
On Error GoTo Handler
Dim text As String
text = Text1.text
Dim username As String
username = Settingsform.Text1.text
If username = "" Then
Chatform.Combo1.AddItem "Please fill in a username!"
Else
Connectform.Winsock1.SendData username & " says : " & text
Chatform.Combo1.AddItem username & " " & "says : " & text
End If
Text1.text = ""
OK Ty.
Here is one example:
Private Sub Form_Load()
On Error GoTo Errorhandler
MsgBox "Hello World!"
Errorhandler:
MsgBox "Error!"
End Sub
Here when you start up the program both two msgboxes comes up...
Here is a simple solution to your problem.
Code:
Private Sub Form_Load()
On Error GoTo Errorhandler
MsgBox "Hello World!"
Exit Sub
Errorhandler:
MsgBox "Error!"
End Sub
Without Exit Sub, both the message boxes will be shown. You have to tell the program when to execute what piece of code. Exit Sub ensures that the code in the error handler does not get called unless there is an actual error.
Use [code]your code here[/code] tags when you post source code
Search here before you post your question, someone might have already asked it before. My Articles
Bookmarks