catch Run-time error 40006 (VB6.0)
-
Hello, Is it possible to catch errors like Run-time error 40006 in Visual Basic 6.0? So i can write my own error message. Thanks. Bas
Other than the usual
On Error Goto
, no there isn't. 40006 is a problem with the underlying WinSock Socket. The best solution isn't to hide the error behind a pretty message, but to fix the code that's generating it.A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007 -
Other than the usual
On Error Goto
, no there isn't. 40006 is a problem with the underlying WinSock Socket. The best solution isn't to hide the error behind a pretty message, but to fix the code that's generating it.A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007Hello Dave, Thanks for the information. The situation is as follow: I am making a tool which checks a range of portnumbers. I made a listener tool, which listens on the portnumbers, and a tool which tries to communicate on the portnumbers. One by one. I am using a textbox to show a portnumber is open or closed. When a portnumber is closed (by a firewall or something else) the 40006 error is shown. But i am not sure if error 40006 only pops if a portnumber is closed or also in other situations. Regards, Bas
-
Hello Dave, Thanks for the information. The situation is as follow: I am making a tool which checks a range of portnumbers. I made a listener tool, which listens on the portnumbers, and a tool which tries to communicate on the portnumbers. One by one. I am using a textbox to show a portnumber is open or closed. When a portnumber is closed (by a firewall or something else) the 40006 error is shown. But i am not sure if error 40006 only pops if a portnumber is closed or also in other situations. Regards, Bas
The error can pop up under any WinSock circumstances, not just when you close a socket.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007