?
Solved

Telephone number...

Posted on 1998-12-15
8
Medium Priority
?
130 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
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
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 800 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
this video summaries big data hadoop online training demo (http://onlineitguru.com/big-data-hadoop-online-training-placement.html) , and covers basics in big data hadoop .
Suggested Courses

807 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