Hi,
Is there an easier way to convert a UInt16 to Int16 than the way I am
currently doing it
Dim iValue As Int16
Dim uValue As UInt16
Try
uValue = GetValue(WMI.NetworkAdapter, "Availability")
iValue = CType(uValue.ToString, Int16)
Catch ex As Exception
ErrorSystem.ErrMsg(ex)
iValue = -1
End Try
Return iValue
I have tried
Dim iValue As Int32
Try
iValue = CType(GetValue(WMI.NetworkAdapter, "InterfaceIndex"), Int32)
Catch ex As Exception
ErrorSystem.ErrMsg(ex)
iValue = -1
End Try
Return iValue
but get the following exception
System.InvalidCastException: Cast from type 'UInt32' to type 'Integer'
is not valid.
at
Microsoft.VisualBasic.CompilerServices.IntegerType .FromObject(Object
Value)
at Assimilator.SDK.Network.NICProperties.get_ConfigMa nagerErrorCode()
in V:\VBNET\Assimilator Ver 4.2\Assimilator.SDK\clsNICProperties.vb:line
190
Thank You
Mark Hollander
*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!