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 1.0.0.0, P3 47fc0f45, P4 p2pchat, P5 1.0.0.0, P6 47fc0f45, P7 d, P8 c6, P9 system.invalidoperationexception, P10 NIL.

Thanks

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

Niek

Protocol is UDP, Remote Host is 255.255.255.255, 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

        AxWinsock1.SendData(dataOut)

        txtMsg.Clear()

    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

        AxWinsock1.GetData(dataIn)

        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.

Do the other PC's have .net 2.0 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?

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.