source.tightDev.net Because you don't need to be big, rich and famous to create something great.

Content of "\UsbHidWrapper\HidException.vb"

Imports System.Runtime.Serialization

Namespace USB

	<Serializable()> Friend Class HidException
		Inherits ApplicationException

		Private Sub New(ByVal info As SerializationInfo, ByVal context As StreamingContext)
			MyBase.New(info, context)
		End Sub

		Friend Sub New(ByVal message As String)
			MyBase.New(message)
		End Sub
		Friend Shared Function GenerateError(ByVal message As String) As HidException
			Return New HidException("Msg: " & message)
		End Function
		Friend Shared Function GenerateWithWinError(ByVal message As String) As HidException
			Return New HidException("Msg: " & message & " WinEr: " & Marshal.GetLastWin32Error.ToString("X8", ICul))
		End Function

	End Class

End Namespace