System.Runtime.InteropServices.SEHException was unhandled
Message=External component has thrown an exception.
Source=mscorlib
ErrorCode=-2147467259
StackTrace:
at Microsoft.Win32.Win32Native.CloseHandle(IntPtr handle)
at Microsoft.Win32.SafeHandles.SafeFileHandle.ReleaseHandle()
at System.Runtime.InteropServices.SafeHandle.InternalFinalize()
at System.Runtime.InteropServices.SafeHandle.Dispose(Boolean disposing)
at System.Runtime.InteropServices.SafeHandle.Finalize()
InnerException:
SEHException に関するすべての投稿を読みましたが、解決できません。助けてください。これが私が疑うコードです:
If hWinUSBInterface = INVALID_HANDLE_VALUE And hDevice = INVALID_HANDLE_VALUE Then
If Not tmrAutoConnect.Enabled Then
RaiseEvent Notify(2, "Not connected")
End If
Return
End If
Try
If hWinUSBInterface <> INVALID_HANDLE_VALUE Then
WinUsb_Free(hWinUSBInterface)
hWinUSBInterface = INVALID_HANDLE_VALUE
End If
If hDevice <> INVALID_HANDLE_VALUE Then
If CloseHandle(hDevice) Then
hDevice = INVALID_HANDLE_VALUE
RaiseEvent Disconnected()
Else
Dim ErrorStatus As Integer = Err.LastDllError
RaiseEvent Error(1, ErrorStatus, "Disconnect")
End If
End If
Catch ex As Exception
End Try
何か案が?ありがとう