检测到ReportAvOnComRelease

时间:2015-11-10 05:39:55

标签: c# vb.net

很抱歉给您带来不便,我再次提出疑问。 我在VB.NET中遇到了一个非常常见的错误(参见下面的错误)。 我认为这完全是关于COM的问题,但我不知道。 这是在我遇到winsock_dataArrival函数时发生的。 请帮助和尊重,我只是一个.NET初学者。 我还附上了下面的图片。

  

检测到ReportAvOnComRelease

Message: An exception was caught but handled while releasing a COM interface pointer through Marshal.Release or Marshal.ReleaseComObject or implicitly after the corresponding RuntimeCallableWrapper was garbage collected. This is the result of a user refcount error or other problem with a COM object's Release. Make sure refcounts are managed properly.  The COM interface pointer's original vtable pointer was 0x27582bb8. While these types of exceptions are caught by the CLR, they can still lead to corruption and data loss so if possible the issue causing the exception should be addressed

代码:

Private Sub Winsock1_DataArrival(ByVal eventSender As System.Object, ByVal eventArgs As AxMSWinsockLib.DMSWinsockControlEvents_DataArrivalEvent) Handles Winsock1.DataArrival

        Dim strData As String = ""
        Dim msg As String
        Dim i As Integer
        Static bmsg As Boolean

        On Error Resume Next
        peer.GetData(strData)
        peer.RemoteHost = HOST

        If checkMSG(i) Then
            If b_QALoad Then
                dlgQA.setMSG()
            Else
                If MsgBox("You have " & i & " unread message(s)." & vbCrLf & "Do you want to read it now?", MsgBoxStyle.YesNo + MsgBoxStyle.Information, MYPS_ABR) = MsgBoxResult.Yes Then
                    dlgQA.ShowDialog()
                End If
            End If
        End If
    End Sub

ReportAvOnComRelease was detected image

1 个答案:

答案 0 :(得分:0)

当下面触发代码时,让我们说它在module1中.. “frmdlg.closeform()”

它调用此程序.. 代码:

document.frmmain.objFP[idx].ImageTextData

之后,我退出了那个module1然后我现在在module2。我注意到了一些代码。 还有“Me.Close”,我想知道它已经关闭但程序再次调用它。 然后,我把它变成了评论的同时.. 那么,VIOLA!没有发生更多错误。 ^^