简体   繁体   中英

.Net Error - System.AccessViolationException: Attempted to read or write protected memory

I am using server side active x control for paging (http://activexperts.com/xmstoolkit/). The code below worked find on windows 2003 servers but now we moved to windows 2008 and I am getting the following error:

System.AccessViolationException: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. at AXmsCtrl.PagerProtocolSnppClass.Clear() at _Default.Button1_Click(Object sender, EventArgs e) in D:\\Apps\\pagetest\\Default.aspx.vb:line 15

I've searched and read various threads but am not able to find solution. Thanks in advance for your help.

Here is the code:

Partial Class _Default
    Inherits System.Web.UI.Page
    Private objSnppProtocol As PagerProtocolSnpp = New PagerProtocolSnpp
    Private objPagerMessage As PagerMessage = New PagerMessage

    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
        Try

            objPagerMessage.Clear()
            objPagerMessage.Recipient = "12345"
            objPagerMessage.Data = "Testing send page."

            objSnppProtocol.Clear()
            objSnppProtocol.Server = "111.111.11.11"
            objSnppProtocol.ServerPort = System.Int32.Parse("446")
            objSnppProtocol.ServerTimeout = 2000

            objSnppProtocol.ProviderPassword = "2125551212 2125551212"
            objSnppProtocol.LogFile = Server.MapPath("log.txt")

            ' Send
            objSnppProtocol.Send(objPagerMessage)
            UpdateResult(objSnppProtocol.LastError, objSnppProtocol.ProviderResponse)
        Catch exc As Exception
            Response.Write("<br><font color='maroon'><strong>Paging ERROR:</strong></font><br>" & exc.ToString() & "<br>Trace: " & exc.StackTrace.ToString())
        End Try
    End Sub

    Private Sub UpdateResult(ByVal numResult As System.Int32, ByVal strResponse As String)
        ctlResult.Text = numResult.ToString() & ": " & objSnppProtocol.GetErrorDescription(numResult)
        ctlResponse.Text = strResponse
    End Sub
End Class

Your component is crashing in unmanaged code - contact the vendor. - also are you trying to run this on a 64 bit system now for 32 bit code?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM