I made a network chat program on my desktop pc and it works fine, but when I try to run it on my laptop it does not work and comes up with this error: http://ecp-clan.frih.net/untitled.PNG.

Here is a description of the error:
EventType clr20r3, P1 p2pchat.exe, P2, P3 47fc0f45, P4 p2pchat, P5, P6 47fc0f45, P7 d, P8 c6, P9 system.invalidoperationexception, P10 NIL.


8 Years
Discussion Span
Last Post by munkey_boy

You're probably messing with memory that isn't yours, or accessing a file that is accessed at the same time by something else, or writing to a socket that was closed or never opened, or ....

Without seeing your code, it just a guessing game


Ok and how would I post that? Should I upload the whole solution?

Edit: Also, I have discovered that it happens with any program that has winsock, because another application that I wrote which doesn't use winsock works fine.


If you think that winsock is the problem, then post all the code that uses it here. Also initialization.
be sure to use [code] your code here [/code] tags



Protocol is UDP, Remote Host is, Local Port is 1 and Remote Port is 1. But I don't think it's the port that is the problem as my other winsock program only uses Winsock.LocalIP() and no ports. My Winsock code is:

Private Sub btnSend_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSend.Click
        Dim dataOut As String

        dataOut = txtName.Text & ": " & txtMsg.Text



    End Sub

    Private Sub AxWinsock1_DataArrival(ByVal sender As Object, ByVal e As AxMSWinsockLib.DMSWinsockControlEvents_DataArrivalEvent) Handles AxWinsock1.DataArrival
        Dim dataIn As String

        dataIn = 0


        txtChat.Text = txtChat.Text & dataIn & vbNewLine

    End Sub
End Class

Edit: And thanks for helping me Niek.


More info: I tested it on about 7 computers, only 2 of them have vb.net 2008 installed and they were the only two that it worked on. I'm not sure what it could be, but it probably has something to do with vb.net not being installed.


Yes, well I know for sure that one of them does as it is my laptop.


Sorry this was an accidental double post, could a moderator please delete this?

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.