Dialing gprs modem programatically

hi ,
      I have a modem equipped with gprs enabled sim.I am working in windows2000.I connected to gprs network using my dial-up connection.After some time,it gets disconnected. I need some way to dial the gprs modem(using  number *99***1#) programatically in Delphi programming language.    
                             Thanks.
AsmitagoyalAsked:
Who is Participating?
 
imarshadCommented:
From a website I have found the following code in Delphi that will dial the default code....

To dial the default Dial-Up Networking Connection, you can use the following Function:  (Returns True if successfull)

Uses Registry, windows;

Function DUNDialDefault(Hide : Boolean) : Boolean;
// Show or hide the dial-up dialog
var Reg : TRegistry;
var TempResult : Boolean;
var Name, con : String;
var ASW : Integer;
begin
Reg := TRegistry.Create;
Reg.RootKey := HKEY_CURRENT_USER;
if Reg.OpenKey('\RemoteAccess', False) then
  begin
    TempResult := True;
    Name := Reg.ReadString('Default');
  end
else begin
tempresult := False;
end;
Reg.Free;
if TempResult = True then
  begin
    if Hide = True then ASW := SW_HIDE
    else ASW := SW_SHOWDEFAULT;
    con := 'rnaui.dll,RnaDial ' + Name;
    ShellExecute(0, nil, 'rundll32.exe' , PChar
                  (con), 'C:\windows\', ASW);
end;
Result := tempResult;
end;

Imran
0
 
imarshadCommented:
Not sure about delphi but I dial out my GPRS connection named "GPRS-DialUP" using the following code in VB6.....

Public Declare Function InternetDial Lib "wininet.dll" Alias "InternetDialA" (ByVal hwndParent As Long, ByVal strEntryName As String, ByVal dwFlags As Long, lpdwConnection As Long, ByVal dwReserved As Long) As Long

Call InternetDial(Me.hWnd, "GPRS-DialUP", 2&, HandleConnection, 0&)

Imran
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.