1
對不便,我有一個問題。 我在VB.NET中有一個非常不常見的錯誤(請參閱下面的錯誤)。 我認爲這是所有關於COM問題,但我不知道它。 這是我在winsock_dataArrival函數時發生的。 請幫助和尊重,我只是一個.NET初學者。 我還附上了下圖。ReportAvOnComRelease檢測到
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
使用古老的VB6 Winsock控件是一個錯誤。改爲使用System.Net命名空間中的類。 –
UP!需要幫助感謝管理員。 =)) –