K
Kent Briggs
I can't get SetWirelessSettings() to work on my Dell Axim x51 to connect
to a specific access point called WGN. It fires off this exception each
time:
ArgumentOutOfRangeException
at System.Runtime.InteropServices.Marshal.CopyInternal()
at OpenNETCF.Net.WLANConfigurationList.Item()
at OpenNETCF.Net.Adapter.SetWirelessSettings()
My VB 2005 code does this:
Private Sub BindWGNBtn_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BindWGNBtn.Click
Dim MyAdapter As OpenNETCF.Net.Adapter
Dim MyAdapters As OpenNETCF.Net.AdapterCollection
MyAdapters = Networking.GetAdapters
Dim n As Integer = MyAdapters.Count
If n = 0 Then
MsgBox("No network adapter currently active. Turn WiFi on.")
Exit Sub
End If
Dim i As Integer
For i = 0 To n - 1
MyAdapter = MyAdapters.Item(i)
If MyAdapter.IsWireless Then
MyAdapter.SetWirelessSettings("WGN")
MyAdapter.RebindAdapter()
End If
Next
End Sub
What am I doing wrong here? By the way, I have no problem manually
connecting to that access point (a wireless LinkSys router) using the
Dell WLAN utility.
to a specific access point called WGN. It fires off this exception each
time:
ArgumentOutOfRangeException
at System.Runtime.InteropServices.Marshal.CopyInternal()
at OpenNETCF.Net.WLANConfigurationList.Item()
at OpenNETCF.Net.Adapter.SetWirelessSettings()
My VB 2005 code does this:
Private Sub BindWGNBtn_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles BindWGNBtn.Click
Dim MyAdapter As OpenNETCF.Net.Adapter
Dim MyAdapters As OpenNETCF.Net.AdapterCollection
MyAdapters = Networking.GetAdapters
Dim n As Integer = MyAdapters.Count
If n = 0 Then
MsgBox("No network adapter currently active. Turn WiFi on.")
Exit Sub
End If
Dim i As Integer
For i = 0 To n - 1
MyAdapter = MyAdapters.Item(i)
If MyAdapter.IsWireless Then
MyAdapter.SetWirelessSettings("WGN")
MyAdapter.RebindAdapter()
End If
Next
End Sub
What am I doing wrong here? By the way, I have no problem manually
connecting to that access point (a wireless LinkSys router) using the
Dell WLAN utility.