TRasObject

Implementation of Remote Access API as Delphi component

(C) Copyright 2001, Serge Ryvkin

 

  1. Realized possibilities
  2. Purchasing
  3. Installation
  4. Usage

1. Realized possibilities

TRasObject component allows to developer to use remote access service (usually, modem dialup) in simplest way. The developer can create, modify and delete connections, dial selected connection and disconnect. The component is realized on base of Microsoft Remote Access Service API, translated for Delphi by Davide Moretti. It is checked on Windows 95 (with additional MS DLL library RINAPH.DLL), Windows 95 OSR2, Windows 98, Windows 98 SR1, Windows ME, Windows 2000. Free version of the component is compiled by Borland Delphi 5.0. 

2. Purchasing

You can use free of charge for commercial and non commercial purposes compiled version of the component and source code of test application. If you want to purchase component source code, you can do it through ShareIt! registration service pressing the following button.

3. Installation

Unpack received file RasObject.zip to separate folder. From Delphi IDE select Component | Install Packages and the button Add. In dialog select RasPack.bpl file and press Open button. Package will be installed, and the TRasObject component will appear on palette Ryvkin.

To compile properly the application with the component, .dcu files must be in the same folder as RasPack.bpl file.

4. Usage

TRasObject is standard Delphi component. It can be placed on form or data module, developer can adjust properties and set events and use its possibilities. 

Usually developer needs to realize simple task to allow his application to access to the RAS - manage connection entries, dial and hang up. TRasObject allows it! You can manage connections (create, modify, rename, delete), dial synchronously of asynchronously and hang up. Through  components properties you can receive full and real time updated list of available and active connections, and assign event to receive RAS status.

Properties:

PhoneBook: TStringList

Developer can use PhoneBook to access to full list of available connections. The list is updating dynamically with refresh interval, selected by RefreshInterval property. This list is read-only. Dynamic updates available during runtime only.

ActiveNames: TStringList

Developer can use ActiveNames during design time to access to full list of names of active connections. The list is updating dynamically with refresh interval, selected by RefreshInterval property. This list is read-only. Dynamic updates available during runtime only. During runtime it would be more convenient to use ActiveConnections field.

RefreshInterval: integer

Fields:

ActiveConnections: array of TRasObjectActiveConnection

type TRasObjectActiveConnection = record
    Handle: Pointer;                      // Connection handle
    Name: string;                         // Name in phonebook
    DeviceType: string;                   // Used device type
    DeviceName: string;                   // Used device name
    Status: string;                       // Status string
end;
Developer can use ActiveConnections to receive real-time status of all active connections. The list is updating dynamically with refresh interval, selected by RefreshInterval property. This list is read-only. Dynamic updates available during runtime only.

Parameters: TRasObjectParameters

type TRasObjectParameters = class
.......
public 
  Domain: string;            // MS Domain name
  Username: string;          // User name
  Password: string;          // Password
  PhoneNumber: string;       // Phone number
  CallbackNumber: string;    // Callback number

  procedure Clear;           // Clear parameters
  function IsEmpty: boolean; // Check, if all parameterss are empty
end;

Developer can use this field to store and retrieve RAS call parameters from phonebook entry using methods .

Methods:

constructor Create(aOwner: TComponent);

destructor Destroy;

function CreateEntry: boolean;

function EditEntry(const EntryName: string): boolean;

function RenameEntry(const EntryName: string; const NewEntryName: string): boolean;

function DeleteEntry(const EntryName: string): boolean;

function GetParameters(const EntryName: string): boolean;

function SetParameters(const EntryName: string): boolean; 

function Dial(const EntryName: string; DialMode: TRasObjectMode): boolean; 

function HangUp(Connection: TRasObjectActiveConnection): boolean; overload; 

function HangUp(const EntryName: string): boolean; overload; 

procedure Wait(Time: DWORD); 

Events:

OnStatusChange: procedure(Sender: TObject; IsError: boolean; StatusString: string)

 

Serge Ryvkin
to@ryvkin.com