ecojohnson
Programmer
I am new to Visual Basic (one week experience). I have a program that utilizes winsock. The program is the "sender" which sends data to a remote computer. It's incredibly complicated, but works rather well.
However, there is one nagging problem. Our users tend to occasionally get a Run-time error "52" Bad file name or number error. This stops the entire "sending" process, and the user must click [OK] at this message, restart the sender, and everything is back to normal.
It would be nice to somehow trap this error, so that when it occurs, I can automatically restart the sender, rather than forcing the user to. But, the problem is that I can't reproduce this error. More importatnly, I don't know specifically when it occurs. The users who are getting this tend to have a certain type of Novell service pack running on the same machine which I don't have. Therefore, I can't reproduce this error. Plus, it occurs randomly. I doesn't happen at any specific time.
So, my question is this: is there a way that I can trap this error, so that when it occurs, I can write some code to do something, rather than just having a big error jump out on the screen. And, if this is possible, where would I put this error trap in the existing code? Again, I don't know where the error occurs, so I wouldn't have a clue as to where to put this error trap. Is there someplace generic that I can place this so that no matter where/when this error occurs, this error trap can be called?
However, there is one nagging problem. Our users tend to occasionally get a Run-time error "52" Bad file name or number error. This stops the entire "sending" process, and the user must click [OK] at this message, restart the sender, and everything is back to normal.
It would be nice to somehow trap this error, so that when it occurs, I can automatically restart the sender, rather than forcing the user to. But, the problem is that I can't reproduce this error. More importatnly, I don't know specifically when it occurs. The users who are getting this tend to have a certain type of Novell service pack running on the same machine which I don't have. Therefore, I can't reproduce this error. Plus, it occurs randomly. I doesn't happen at any specific time.
So, my question is this: is there a way that I can trap this error, so that when it occurs, I can write some code to do something, rather than just having a big error jump out on the screen. And, if this is possible, where would I put this error trap in the existing code? Again, I don't know where the error occurs, so I wouldn't have a clue as to where to put this error trap. Is there someplace generic that I can place this so that no matter where/when this error occurs, this error trap can be called?