PC Review Forums Newsgroups Windows XP Windows XP WMI -2147217403 (80041005) type mismatch error on Dell D 620 laptop

Reply

-2147217403 (80041005) type mismatch error on Dell D 620 laptop

 
Thread Tools Rate Thread
Old 07-03-2007, 12:29 PM   #1
hardikbelani@gmail.com
Guest
 
Posts: n/a
Default -2147217403 (80041005) type mismatch error on Dell D 620 laptop


-2147217403 (80041005) type mismatch error on Dell D 620 laptop

I have following code to get information about network interfaces

-----------------------------------------------------------
Dim moMgmtObjSearcher As ManagementObjectSearcher = New
ManagementObjectSearcher
Dim moMgmtObjCollection As ManagementObjectCollection
Dim moMgmtObject As Management.ManagementObject
Dim moMgmtBaseObject As ManagementBaseObject
Dim moMgmtScope As Management.ManagementScope

Dim sWmiQuery As String = TextBox2.Text
Try
Dim oEnumerationOptions As New EnumerationOptions
oEnumerationOptions.ReturnImmediately = True

moMgmtObjSearcher.Scope.Path.Path = "root\cimv2"
moMgmtObjSearcher.Query.QueryString = "SELECT *
FROM Win32_NetworkAdapter WHERE ProductName = '" & I_sProductName & "'
AND ( AdapterTypeId = 0 OR AdapterTypeId = null ) AND NetConnectionId !
= null "

moMgmtObjSearcher.Options = oEnumerationOptions

moMgmtObjCollection = moMgmtObjSearcher.Get
For Each moMgmtObject In moMgmtObjCollection
If Not moMgmtObject Is Nothing Then
Return moMgmtObject
End If
Next
Return Nothing
Catch ex As Exception
AppendToLog("testWin32NetworkAdapterObject - Exception:" &
ex.Message + Space(5) + ex.Source + Space(5) + ex.StackTrace)
Return Nothing
End Try

----------------------------------------------------------------------------

This code fine on all the laptops on windows XP platform.

Now on a specific laptop Dell D620 which uses Intel(R) PRO/Wireless
3945ABG Network card for wifi connection, this code does not work and
give me following exeption if i disable my wireless interface card.

Exception(05-03-2007 2:4:54):GetWin32NetworkAdapterObject -
ex.ErrorCode = -2147217403
Exception(05-03-2007 2:4:54):GetWin32NetworkAdapterObject - Type
mismatch System.Management at
System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus
errorCode)
at System.Management.ManagementObjectEnumerator.MoveNext()
at
SGClient.SGClientHelperLib.cNICAdapter.GetWin32NetworkAdapterObject(String
I_sProductName, String I_sMacAddress, Int32 I_iDeviceId, String
I_sFields)

This exception occurs only if i disable my network card and on only
Dell D 620 laptop.

Any kind of help is appreciated.

Thanks in Advance,
Hardik Belani

  Reply With Quote
Old 11-03-2007, 12:18 AM   #2
Marty List
Guest
 
Posts: n/a
Default Re: -2147217403 (80041005) type mismatch error on Dell D 620 laptop


I'm curious to know why you added "OR AdapterTypeId = null" to your query.
And does the behavior change if you remove that?


<hardikbelani@gmail.com> wrote in message
news:1173270557.857425.79640@8g2000cwh.googlegroups.com...
> -2147217403 (80041005) type mismatch error on Dell D 620 laptop
>
> I have following code to get information about network interfaces
>
> -----------------------------------------------------------
> Dim moMgmtObjSearcher As ManagementObjectSearcher = New
> ManagementObjectSearcher
> Dim moMgmtObjCollection As ManagementObjectCollection
> Dim moMgmtObject As Management.ManagementObject
> Dim moMgmtBaseObject As ManagementBaseObject
> Dim moMgmtScope As Management.ManagementScope
>
> Dim sWmiQuery As String = TextBox2.Text
> Try
> Dim oEnumerationOptions As New EnumerationOptions
> oEnumerationOptions.ReturnImmediately = True
>
> moMgmtObjSearcher.Scope.Path.Path = "root\cimv2"
> moMgmtObjSearcher.Query.QueryString = "SELECT *
> FROM Win32_NetworkAdapter WHERE ProductName = '" & I_sProductName & "'
> AND ( AdapterTypeId = 0 OR AdapterTypeId = null ) AND NetConnectionId !
> = null "
>
> moMgmtObjSearcher.Options = oEnumerationOptions
>
> moMgmtObjCollection = moMgmtObjSearcher.Get
> For Each moMgmtObject In moMgmtObjCollection
> If Not moMgmtObject Is Nothing Then
> Return moMgmtObject
> End If
> Next
> Return Nothing
> Catch ex As Exception
> AppendToLog("testWin32NetworkAdapterObject - Exception:" &
> ex.Message + Space(5) + ex.Source + Space(5) + ex.StackTrace)
> Return Nothing
> End Try
>
> ----------------------------------------------------------------------------
>
> This code fine on all the laptops on windows XP platform.
>
> Now on a specific laptop Dell D620 which uses Intel(R) PRO/Wireless
> 3945ABG Network card for wifi connection, this code does not work and
> give me following exeption if i disable my wireless interface card.
>
> Exception(05-03-2007 2:4:54):GetWin32NetworkAdapterObject -
> ex.ErrorCode = -2147217403
> Exception(05-03-2007 2:4:54):GetWin32NetworkAdapterObject - Type
> mismatch System.Management at
> System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus
> errorCode)
> at System.Management.ManagementObjectEnumerator.MoveNext()
> at
> SGClient.SGClientHelperLib.cNICAdapter.GetWin32NetworkAdapterObject(String
> I_sProductName, String I_sMacAddress, Int32 I_iDeviceId, String
> I_sFields)
>
> This exception occurs only if i disable my network card and on only
> Dell D 620 laptop.
>
> Any kind of help is appreciated.
>
> Thanks in Advance,
> Hardik Belani
>


  Reply With Quote
Old 11-03-2007, 12:32 AM   #3
Marty List
Guest
 
Posts: n/a
Default Re: -2147217403 (80041005) type mismatch error on Dell D 620 laptop


I'm curious to know why you added "OR AdapterTypeId = null" to your query.
And does the behavior change if you remove that?


<hardikbelani@gmail.com> wrote in message
news:1173270557.857425.79640@8g2000cwh.googlegroups.com...
> -2147217403 (80041005) type mismatch error on Dell D 620 laptop
>
> I have following code to get information about network interfaces
>
> -----------------------------------------------------------
> Dim moMgmtObjSearcher As ManagementObjectSearcher = New
> ManagementObjectSearcher
> Dim moMgmtObjCollection As ManagementObjectCollection
> Dim moMgmtObject As Management.ManagementObject
> Dim moMgmtBaseObject As ManagementBaseObject
> Dim moMgmtScope As Management.ManagementScope
>
> Dim sWmiQuery As String = TextBox2.Text
> Try
> Dim oEnumerationOptions As New EnumerationOptions
> oEnumerationOptions.ReturnImmediately = True
>
> moMgmtObjSearcher.Scope.Path.Path = "root\cimv2"
> moMgmtObjSearcher.Query.QueryString = "SELECT *
> FROM Win32_NetworkAdapter WHERE ProductName = '" & I_sProductName & "'
> AND ( AdapterTypeId = 0 OR AdapterTypeId = null ) AND NetConnectionId !
> = null "
>
> moMgmtObjSearcher.Options = oEnumerationOptions
>
> moMgmtObjCollection = moMgmtObjSearcher.Get
> For Each moMgmtObject In moMgmtObjCollection
> If Not moMgmtObject Is Nothing Then
> Return moMgmtObject
> End If
> Next
> Return Nothing
> Catch ex As Exception
> AppendToLog("testWin32NetworkAdapterObject - Exception:" &
> ex.Message + Space(5) + ex.Source + Space(5) + ex.StackTrace)
> Return Nothing
> End Try
>
> ----------------------------------------------------------------------------
>
> This code fine on all the laptops on windows XP platform.
>
> Now on a specific laptop Dell D620 which uses Intel(R) PRO/Wireless
> 3945ABG Network card for wifi connection, this code does not work and
> give me following exeption if i disable my wireless interface card.
>
> Exception(05-03-2007 2:4:54):GetWin32NetworkAdapterObject -
> ex.ErrorCode = -2147217403
> Exception(05-03-2007 2:4:54):GetWin32NetworkAdapterObject - Type
> mismatch System.Management at
> System.Management.ManagementException.ThrowWithExtendedInfo(ManagementStatus
> errorCode)
> at System.Management.ManagementObjectEnumerator.MoveNext()
> at
> SGClient.SGClientHelperLib.cNICAdapter.GetWin32NetworkAdapterObject(String
> I_sProductName, String I_sMacAddress, Int32 I_iDeviceId, String
> I_sFields)
>
> This exception occurs only if i disable my network card and on only
> Dell D 620 laptop.
>
> Any kind of help is appreciated.
>
> Thanks in Advance,
> Hardik Belani
>


  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off