Solved

Telephone number...

Posted on 1998-12-15
8
124 Views
Last Modified: 2012-03-15
I need change then number for an RAS access in Windows 95. Somebody knows a way to make this?

PD: sorry, but my english is not so good!
0
Comment
Question by:Marcelito
  • 6
  • 2
8 Comments
 
LVL 4

Expert Comment

by:dwwang
ID: 1351147
goto http://www.magsys.co.uk/delphi/rascomp.zip
to download the RAS component , you can get all you want.

If you need do it by few lines of code, just look into the source code of this component
0
 
LVL 4

Expert Comment

by:dwwang
ID: 1351148
Sorry, I just realize that the API RasSetEntryDialParams can modify any parameters except the phone number. So if this component does not help, just reject my answer :-(
0
 
LVL 4

Expert Comment

by:dwwang
ID: 1351149
Hi, sorry for my boldness, but I found another API can do this:
RasSetEntryProperties

Function RasSetEntryProperties (      // ANGUS      -  from RNAPH.DLL
      lpszPhonebook,
      szEntry: PChar;
        lpbEntry: Pointer;
      dwEntrySize: Longint;
      lpbDeviceInfo: Pointer;
      dwDeviceInfoSize: Longint
      ): Longint; stdcall; external 'RNAPH.DLL'

You can look into the Win32 API's help to see detailed usage.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
LVL 4

Expert Comment

by:dwwang
ID: 1351150
Hi, this is dwwang again :)

download this component, and this time you really get what you want:
http://mirror.aarnet.edu.au/delphi/ftp/d20free/d_ras.zip

I have tested it myself, so hopefully you can't reject my answer now ^_^
0
 

Author Comment

by:Marcelito
ID: 1351151
Can you send me an example?
Please, send me the response and I will accept!

Thanks!!
0
 
LVL 4

Accepted Solution

by:
dwwang earned 200 total points
ID: 1351152
OK, of course, I will arrange it and paste here or send to you!
0
 
LVL 4

Expert Comment

by:dwwang
ID: 1351153
procedure TForm1.Button1Click(Sender: TObject);
var
  entry: LPRasEntry;
  entrySize, devinfoSize: Integer;
  entryName: string;

  begin
  entryName := 'YourDesiredEntryName';//such as "myconnection"
  entrySize := 0;
  devinfoSize := 0;

  if RasGetEntryProperties(nil, PChar(entryName),
      nil, entrySize, nil, devinfoSize) <> ERROR_BUFFER_TOO_SMALL then
    begin
    ShowMessage('RasGetEntryProperties failed.');
    Exit;
    end;

    entry := AllocMem(entrySize);
    entry^.dwSize := SizeOf(TRasEntry);
    RasGetEntryProperties(nil, PChar(entryName), entry, entrySize, nil, devinfoSize);

    entry^.dwSize := SizeOf(TRasEntry);
    StrPCopy(entry^.szLocalPhoneNumber, '1234567890');
    RasSetEntryProperties(nil, PChar(entryName),entry, SizeOf(TRasEntry), nil, 0)

   end;

This procedure is fully tested, for it to work, you must download the component as I suggested above, and use the ras.pas in the proper form.

Regards,
Wang
0
 

Author Comment

by:Marcelito
ID: 1351154
Excellent!!

It´s work perfectly!!

Thanks for the feedback!!
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
Introduction Raise your hands if you were as upset with FireMonkey as I was when I discovered that there was no TListview.  I use TListView in almost all of my applications I've written, and I was not going to compromise by resorting to TStringGrid…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

829 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question