From: Blueforce on
I am developing a IM client using VB.NET CF and the Smartphone APIs. I
can't seem to get the app to turn on the "network" connection such that
the application can login. Does anyone have any idea how to do this on
a Motorola Q using the Smartphone SDK?

I also bought the OpenNetCF framework and attempted to use the
ConnectionManager, but still to no avail. Here is the code:

Public Class Form1
Public WithEvents OpenNetCF As New OpenNETCF.Net.ConnectionManager

If MenuItem6.Text = "Login" Then
Label1.Text = "Attempting login..."
Dim servername As String = "http://www.google.com"
OpenNetCF.Timeout = 30
OpenNetCF.Connect(OpenNetCF.MapUrl(servername), False,
ConnectionMode.Asynchronous)
'If OpenNetCF.Status =
Global.OpenNETCF.Net.ConnectionStatus.Connected Then
Xmpps1.IMServer = XMPPserver
Xmpps1.SSLCertStore = "MY"
Xmpps1.SSLCertStoreB = New Byte() {CType(77, Byte),
CType(89, Byte)}
Xmpps1.SSLCertStoreType =
nsoftware.IPWorksSSL.XmppsSSLCertStoreTypes.sstUser
Xmpps1.SSLStartMode =
nsoftware.IPWorksSSL.XmppsSSLStartModes.sslExplicit
Try
Xmpps1.Connect(XMPPlogin, XMPPpassword)
Catch ex As Exception
System.Windows.Forms.MessageBox.Show(ex.Message)
Label1.Text = "Login failed. Please try again..."
End Try
If Xmpps1.Connected = True Then
MenuItem6.Text = "Logout"
Xmpps1.ChangePresence(1, "Online")
Label1.Visible = False
PictureBox1.Visible = False
UpdateLVW()
Timer1.Enabled = True
End If
End If

From: Simon Hart on
When you say "turn on the network connection" what do you mean? What
happends? what exceptions if any do you get as a result of executing the code
below.

If you mean you want to control the radio, ie is it in flight mode, do I
have GPRS capabilities, then you need to use TAPI which is part of phone
edition devices.
The procedure you need to find out whether flight mode is on or not is
lineGetEquipmentState.

Simon.

"Blueforce" wrote:

> I am developing a IM client using VB.NET CF and the Smartphone APIs. I
> can't seem to get the app to turn on the "network" connection such that
> the application can login. Does anyone have any idea how to do this on
> a Motorola Q using the Smartphone SDK?
>
> I also bought the OpenNetCF framework and attempted to use the
> ConnectionManager, but still to no avail. Here is the code:
>
> Public Class Form1
> Public WithEvents OpenNetCF As New OpenNETCF.Net.ConnectionManager
>
> If MenuItem6.Text = "Login" Then
> Label1.Text = "Attempting login..."
> Dim servername As String = "http://www.google.com"
> OpenNetCF.Timeout = 30
> OpenNetCF.Connect(OpenNetCF.MapUrl(servername), False,
> ConnectionMode.Asynchronous)
> 'If OpenNetCF.Status =
> Global.OpenNETCF.Net.ConnectionStatus.Connected Then
> Xmpps1.IMServer = XMPPserver
> Xmpps1.SSLCertStore = "MY"
> Xmpps1.SSLCertStoreB = New Byte() {CType(77, Byte),
> CType(89, Byte)}
> Xmpps1.SSLCertStoreType =
> nsoftware.IPWorksSSL.XmppsSSLCertStoreTypes.sstUser
> Xmpps1.SSLStartMode =
> nsoftware.IPWorksSSL.XmppsSSLStartModes.sslExplicit
> Try
> Xmpps1.Connect(XMPPlogin, XMPPpassword)
> Catch ex As Exception
> System.Windows.Forms.MessageBox.Show(ex.Message)
> Label1.Text = "Login failed. Please try again..."
> End Try
> If Xmpps1.Connected = True Then
> MenuItem6.Text = "Logout"
> Xmpps1.ChangePresence(1, "Online")
> Label1.Visible = False
> PictureBox1.Visible = False
> UpdateLVW()
> Timer1.Enabled = True
> End If
> End If
>
>