Link to home
Start Free TrialLog in
Avatar of scogger1974
scogger1974

asked on

eVB Start the GPRS connection

I am trying to figure out how to initiate the GPRS Connection on my pocket pc using eVB.  
I have the application working fine.  And when that connection is already activated no problem.

But for instance when I open the brower and type in a webpage . it uses the connection manager to find
the best connection and then connects me to that then pulls the webpage.  

I just really need to know how to get my app to make that connection as well here is my code so far

Option Explicit
Public data1 As String


Private Sub Command1_Click()
Command1.Enabled = False
Command3.Enabled = False
WinSock1.Connect
WinSock1.SendData ("HELLO~")
End Sub

Private Sub Command2_Click()
   WinSock1.Close
   App.End
End Sub

Private Sub Command3_Click()
Command1.Enabled = False
Command3.Enabled = False
WinSock1.Connect
WinSock1.SendData ("POST~")
End Sub

Private Sub Form_Load()
Dim Sockt As AlignConstants

et Sockt = Connect

End Sub

Private Sub Form_OKClick()
    WinSock1.Close
    App.End
End Sub

Private Sub WinSock1_DataArrival(ByVal bytesTotal As Long)
Dim data As String
Dim tr As Variant

WinSock1.GetData data, vbString, bytesTotal
data1 = data1 + data
If Right(data, 1) = "~" Then
    tr = Split(data1, "^")
    Text1.Text = tr(0)
    Command1.Enabled = True
    Command3.Enabled = True
    Command3.Caption = "POST NUMBERS"
    If UBound(tr) > 0 Then Text2.Text = tr(1)
    If UBound(tr) > 1 Then Text3.Text = tr(2)
    If UBound(tr) > 2 Then Text4.Text = tr(3)
    If UBound(tr) > 3 Then Text5.Text = tr(4)
    If UBound(tr) > 4 Then Text6.Text = tr(5)
    If UBound(tr) > 5 Then Text7.Text = tr(6)
    If UBound(tr) > 6 Then Text8.Text = tr(7)
    If UBound(tr) > 7 Then Text9.Text = tr(8)
    Text10.Text = Abs(Text1.Text) + Abs(Text2.Text) + Abs(Text3.Text) + Abs(Text4.Text) + Abs(Text5.Text) + Abs(Text6.Text) + Abs(Text7.Text) + Abs(Text8.Text) + Abs(Text9.Text)
    WinSock1.Close
End If
If Right(data, 1) = "+" Then
    Command3.Caption = "POSTED!"
    Command1.Enabled = True
    Command3.Enabled = True
    Text10.Text = Abs(Text1.Text) + Abs(Text2.Text) + Abs(Text3.Text) + Abs(Text4.Text) + Abs(Text5.Text) + Abs(Text6.Text) + Abs(Text7.Text) + Abs(Text8.Text) + Abs(Text9.Text)
    WinSock1.Close
End If
End Sub

I thought that Winsock1.Connect should do that for me but it doesnt...

Thanks
scog
Avatar of Mikal613
Mikal613
Flag of United States of America image

How about C#

Why evB?
Avatar of scogger1974
scogger1974

ASKER

why?  is it not possible with eVB.  I just have never done anything in C before.. so I don't feel comfortable working in it for a Gui Based Project.
It figures,  Experts exchange used to be not so long ago a good place to get answers.... so far the last 2/3 months no one with half a brain has looked at anything i've posted.

ASKER CERTIFIED SOLUTION
Avatar of Mikal613
Mikal613
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Also C# is a Gui based project (Its the same as VB.net)
Worked perfectly,  Thanks.  sorry for being so rude,  It just seems like people want you to use other things instead of solving the issues your asking about.
To be honest I have not written eVb since 2003 (Or even have it installed anymore) So sometimes links are the only way. :)