Question Need help for Error - Exception from HRESULT: 0x800A0057

remya1000

Well-known member
Joined
Mar 29, 2007
Messages
122
Programming Experience
Beginner
i'm using VB.NET 2003 application program.

i'm using WinSock in this program. on Form_Load, i used this code

VB.NET:
        winsock1.Close()
        winsock1.LocalPort = 1223
        winsock1.Bind()

when i run this program i'm getting .net error. error i'm getting is

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x800A0057): Exception from HRESULT: 0x800A0057
at MSWinsockLib.IMSWinsockControl.Bind(Object LocalPort, Object LocalIP)
--- End of inner exception stack trace ---

if anyone have anyidea what this error means, then please help me... i search this error, but couldn't find any help. can you please help me to figure out what this error means...

thank in advance.
 
Last edited:
Thanks for your help...

this program is used by couple of our clients. for everyone it works fine, only 1 client getting this .NET error. and for the client who gets this error, this program works fine for long time and they said all of the sudden now this .net error start pop up.

See the end of this message for details on invoking
just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************
System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException (0x800A0057): Exception from HRESULT: 0x800A0057
at MSWinsockLib.IMSWinsockControl.Bind(Object LocalPort, Object LocalIP)
--- End of inner exception stack trace ---

to double check which line makes this error, i added some logs
VB.NET:
          gLog.Write("1")
        winsock1.Close()
         gLog.Write("2")
        winsock1.LocalPort = 1223
         gLog.Write("3")
        winsock1.Bind()
         gLog.Write("4")
and when i checked the log after running the program. the log contain
after that .net error is showing.

so i changed winsock1.Close() at the beginning and tried
VB.NET:
         gLog.Write("1")
        winsock1.LocalPort = 1223
        gLog.Write("2")
        winsock1.Bind()
        gLog.Write("3")
no change.. same error at same line.

then i try changing the port number and tried
VB.NET:
         gLog.Write("1")
        winsock1.Close()
         gLog.Write("2")
        winsock1.LocalPort = 1227
         gLog.Write("3")
        winsock1.Bind()
        gLog.Write("4")
no change.. same error at same line.

if anyone have anyidea what this error means, then please help me... i search this error, but couldn't find any help. can you please help me to figure out what this error means...

thank in advance.
 
How many different forums did you post to? I make it at least 20!

If it's broken, inexplicable, rip it out and use something else.. Why are you using COM at all? .NET can do sockets..
 
Back
Top