Hi! I actually just started VB last week so please forgive me if my programming structure seems odd in any way. Anyways, I'm trying to get a SOAP call out from my WM6 phone. It works as long as the connection is up, but it drops after no activity and the only to get it back up is to go into comm manager or open up the browser. Im using VS2008 w/ the Windows Mobile 6 PRO SDK Platform.

When i run the program I want it to Test the connection and if it isn't present then force the dial-up box up like iexplorer. I can get the connection status no problem but it's always coming up as connected to LAN(when it isn't) and InternetAttemptConnect() does nothing. I also tried InternetCheckConnection () for testing and that fails while the LAN works?! Any ideas? Thanks!

*I tried turning active sync off on the phone..everything!! i'm out of ideas. But running internet explorer seems to get the dial-up box up and auto-connecting.

Code:
Private Declare Function InternetGetConnectedState Lib "wininet" (ByRef dwflags As Integer, ByVal dwReserved As Integer) As Integer
    Private Declare Function InternetAttemptConnect Lib "wininet" (ByVal dwReserved As Integer) As Integer

    Private Const CONNECT_LAN As Integer = 2
    Private Const CONNECT_MODEM As Integer = 1
    Private Const CONNECT_PROXY As Integer = 4
    Private Const CONNECT_OFFLINE As Integer = 20
    Private Const CONNECT_CONFIGURED As Integer = 40
    Private Const CONNECT_RAS As Integer = 10

    Private Function TestConnection(ByRef ConnType As String) As Boolean
        Dim dwflags As Integer
        Dim WebTest As Boolean
        ConnType = ""
        WebTest = InternetGetConnectedState(dwflags, 0)
        Select Case WebTest
            Case dwflags And CONNECT_LAN : ConnType = "LAN"
            Case dwflags And CONNECT_MODEM : ConnType = "Modem"
            Case dwflags And CONNECT_PROXY : ConnType = "Proxy"
            Case dwflags And CONNECT_OFFLINE : ConnType = "Offline"
            Case dwflags And CONNECT_CONFIGURED : ConnType = "Configured"
            Case dwflags And CONNECT_RAS : ConnType = "Remote"
        End Select
        TestConnection = WebTest
    End Function
    Private Sub CheckConnection()
        Dim msg As String = ""
        If Not TestConnection(msg) Then
            If InternetAttemptConnect(0) = 0 Then
                MsgBox("Connection Attempted", vbInformation)
            Else
                MsgBox("Connection Failed", vbInformation)
            End If
        Else
            If msg = "LAN" Then
                MsgBox("Connected by LAN", vbInformation)
                'Try connecting anyways
                InternetAttemptConnect(0)
            Else
                MsgBox("Connected by something else", vbInformation)
            End If
        End If

    End Sub