First commit 25/10/1998
This commit is contained in:
13
DialUp/DIALUPT.DPR
Normal file
13
DialUp/DIALUPT.DPR
Normal file
@ -0,0 +1,13 @@
|
||||
program DialUpT;
|
||||
|
||||
uses
|
||||
Forms,
|
||||
Main_F in 'Main_F.pas' {Form1};
|
||||
|
||||
{$R *.RES}
|
||||
|
||||
begin
|
||||
Application.Initialize;
|
||||
Application.CreateForm(TForm1, Form1);
|
||||
Application.Run;
|
||||
end.
|
BIN
DialUp/DIALUPT.RES
Normal file
BIN
DialUp/DIALUPT.RES
Normal file
Binary file not shown.
BIN
DialUp/Main_f.dcu
Normal file
BIN
DialUp/Main_f.dcu
Normal file
Binary file not shown.
BIN
DialUp/Main_f.dfm
Normal file
BIN
DialUp/Main_f.dfm
Normal file
Binary file not shown.
85
DialUp/Main_f.hpp
Normal file
85
DialUp/Main_f.hpp
Normal file
@ -0,0 +1,85 @@
|
||||
// Borland C++ Builder
|
||||
// Copyright (c) 1995, 1998 by Borland International
|
||||
// All rights reserved
|
||||
|
||||
// (DO NOT EDIT: machine generated header) 'Main_F.pas' rev: 3.00
|
||||
|
||||
#ifndef Main_FHPP
|
||||
#define Main_FHPP
|
||||
#include <DialUp.hpp>
|
||||
#include <StdCtrls.hpp>
|
||||
#include <Dialogs.hpp>
|
||||
#include <Forms.hpp>
|
||||
#include <Controls.hpp>
|
||||
#include <Graphics.hpp>
|
||||
#include <Classes.hpp>
|
||||
#include <SysUtils.hpp>
|
||||
#include <Messages.hpp>
|
||||
#include <Windows.hpp>
|
||||
#include <SysInit.hpp>
|
||||
#include <System.hpp>
|
||||
|
||||
//-- user supplied -----------------------------------------------------------
|
||||
|
||||
namespace Main_f
|
||||
{
|
||||
//-- type declarations -------------------------------------------------------
|
||||
class DELPHICLASS TForm1;
|
||||
class PASCALIMPLEMENTATION TForm1 : public Forms::TForm
|
||||
{
|
||||
typedef Forms::TForm inherited;
|
||||
|
||||
__published:
|
||||
Dialup::TDialUp* DialUp;
|
||||
Stdctrls::TListBox* ListBox1;
|
||||
Stdctrls::TButton* Button1;
|
||||
Stdctrls::TButton* Button2;
|
||||
Stdctrls::TButton* Button3;
|
||||
Stdctrls::TButton* Button4;
|
||||
Stdctrls::TRadioButton* RadioButton1;
|
||||
Stdctrls::TRadioButton* RadioButton2;
|
||||
Stdctrls::TLabel* Label1;
|
||||
Stdctrls::TLabel* Status;
|
||||
Stdctrls::TLabel* Status2;
|
||||
Stdctrls::TCheckBox* CheckBox1;
|
||||
void __fastcall Button1Click(System::TObject* Sender);
|
||||
void __fastcall Button2Click(System::TObject* Sender);
|
||||
void __fastcall DialUpEntryGet(System::TObject* Sender, const char * EntryName, const int EntryName_Size
|
||||
);
|
||||
void __fastcall Button3Click(System::TObject* Sender);
|
||||
void __fastcall DialUpConnect(System::TObject* Sender);
|
||||
void __fastcall DialUpError(System::TObject* Sender, int ErrorCode, System::AnsiString ErrorMessage
|
||||
);
|
||||
void __fastcall DialUpDialing(System::TObject* Sender);
|
||||
void __fastcall DialUpNotConnected(System::TObject* Sender, int ErrorCode, System::AnsiString ErrorMessage
|
||||
);
|
||||
void __fastcall DialUpAsyncEvent(System::TObject* Sender, int State, int Error, System::AnsiString
|
||||
MessageText);
|
||||
void __fastcall Button4Click(System::TObject* Sender);
|
||||
void __fastcall DialUpActiveConnection(System::TObject* Sender, int Handle, const Dialup::TRasConnStatusA
|
||||
&Status, System::AnsiString StatusString, const char * EntryName, const int EntryName_Size, const
|
||||
char * DeviceType, const int DeviceType_Size, const char * DeviceName, const int DeviceName_Size);
|
||||
|
||||
void __fastcall Button5Click(System::TObject* Sender);
|
||||
public:
|
||||
/* TCustomForm.Create */ __fastcall virtual TForm1(Classes::TComponent* AOwner) : Forms::TForm(AOwner
|
||||
) { }
|
||||
/* TCustomForm.CreateNew */ __fastcall TForm1(Classes::TComponent* AOwner, int Dummy) : Forms::TForm(
|
||||
AOwner, Dummy) { }
|
||||
/* TCustomForm.Destroy */ __fastcall virtual ~TForm1(void) { }
|
||||
|
||||
public:
|
||||
/* TWinControl.CreateParented */ __fastcall TForm1(HWND ParentWindow) : Forms::TForm(ParentWindow) { }
|
||||
|
||||
|
||||
};
|
||||
|
||||
//-- var, const, procedure ---------------------------------------------------
|
||||
extern PACKAGE TForm1* Form1;
|
||||
|
||||
} /* namespace Main_f */
|
||||
#if !defined(NO_IMPLICIT_NAMESPACE_USE)
|
||||
using namespace Main_f;
|
||||
#endif
|
||||
//-- end unit ----------------------------------------------------------------
|
||||
#endif // Main_F
|
130
DialUp/Main_f.pas
Normal file
130
DialUp/Main_f.pas
Normal file
@ -0,0 +1,130 @@
|
||||
unit Main_F;
|
||||
|
||||
interface
|
||||
|
||||
uses
|
||||
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
|
||||
StdCtrls, DialUp;
|
||||
|
||||
type
|
||||
TForm1 = class(TForm)
|
||||
DialUp: TDialUp;
|
||||
ListBox1: TListBox;
|
||||
Button1: TButton;
|
||||
Button2: TButton;
|
||||
Button3: TButton;
|
||||
Button4: TButton;
|
||||
RadioButton1: TRadioButton;
|
||||
RadioButton2: TRadioButton;
|
||||
Label1: TLabel;
|
||||
Status: TLabel;
|
||||
Status2: TLabel;
|
||||
CheckBox1: TCheckBox;
|
||||
procedure Button1Click(Sender: TObject);
|
||||
procedure Button2Click(Sender: TObject);
|
||||
procedure DialUpEntryGet(Sender: TObject; EntryName: array of Char);
|
||||
procedure Button3Click(Sender: TObject);
|
||||
procedure DialUpConnect(Sender: TObject);
|
||||
procedure DialUpError(Sender: TObject; ErrorCode: Integer;
|
||||
ErrorMessage: String);
|
||||
procedure DialUpDialing(Sender: TObject);
|
||||
procedure DialUpNotConnected(Sender: TObject; ErrorCode: Integer;
|
||||
ErrorMessage: String);
|
||||
procedure DialUpAsyncEvent(Sender: TObject; State, Error: Integer;
|
||||
MessageText: String);
|
||||
procedure Button4Click(Sender: TObject);
|
||||
procedure DialUpActiveConnection(Sender: TObject; Handle: Integer;
|
||||
Status: TRasConnStatusA; StatusString: String; EntryName, DeviceType,
|
||||
DeviceName: array of Char);
|
||||
procedure Button5Click(Sender: TObject);
|
||||
private
|
||||
{ Private declarations }
|
||||
public
|
||||
{ Public declarations }
|
||||
end;
|
||||
|
||||
var
|
||||
Form1: TForm1;
|
||||
|
||||
implementation
|
||||
|
||||
{$R *.DFM}
|
||||
|
||||
procedure TForm1.Button1Click(Sender: TObject);
|
||||
begin
|
||||
ListBox1.Clear; Button2.Enabled:=True;
|
||||
DialUp.GetEntries;
|
||||
end;
|
||||
|
||||
procedure TForm1.Button2Click(Sender: TObject);
|
||||
begin
|
||||
if ListBox1.Items.Count=0 then
|
||||
begin
|
||||
ShowMessage('Choose entry with get entries first');
|
||||
Exit;
|
||||
end;
|
||||
if RadioButton1.Checked then DialUp.DialMode:=dmAsync else DialUp.DialMode:=dmSync;
|
||||
DialUp.Entry:=ListBox1.Items[ListBox1.ItemIndex];
|
||||
DialUp.Dial;
|
||||
end;
|
||||
|
||||
procedure TForm1.DialUpEntryGet(Sender: TObject; EntryName: array of Char);
|
||||
begin
|
||||
ListBox1.Items.Add(PChar(@EntryName[0]));
|
||||
ListBox1.ItemIndex:=0;
|
||||
end;
|
||||
|
||||
procedure TForm1.Button3Click(Sender: TObject);
|
||||
begin
|
||||
DialUp.HangUp;
|
||||
end;
|
||||
|
||||
procedure TForm1.DialUpConnect(Sender: TObject);
|
||||
begin
|
||||
Status2.Caption:='Connected.';
|
||||
end;
|
||||
|
||||
procedure TForm1.DialUpError(Sender: TObject; ErrorCode: Integer;
|
||||
ErrorMessage: String);
|
||||
begin
|
||||
Status2.Caption:='Error';
|
||||
end;
|
||||
|
||||
procedure TForm1.DialUpDialing(Sender: TObject);
|
||||
begin
|
||||
Status2.Caption:='Dialing...'; Application.ProcessMessages;
|
||||
end;
|
||||
|
||||
procedure TForm1.DialUpNotConnected(Sender: TObject; ErrorCode: Integer;
|
||||
ErrorMessage: String);
|
||||
begin
|
||||
Status2.Caption:='Not Connected';
|
||||
end;
|
||||
|
||||
procedure TForm1.DialUpAsyncEvent(Sender: TObject; State, Error: Integer;
|
||||
MessageText: String);
|
||||
begin
|
||||
Status.Caption:=MessageText;
|
||||
if Error<>0 then Status2.Caption:='Error. Press Hangup button next to Dial button.';
|
||||
end;
|
||||
|
||||
procedure TForm1.Button4Click(Sender: TObject);
|
||||
begin
|
||||
ListBox1.Clear; Button2.Enabled:=False;
|
||||
DialUp.GetConnections;
|
||||
end;
|
||||
|
||||
procedure TForm1.DialUpActiveConnection(Sender: TObject; Handle: Integer;
|
||||
Status: TRasConnStatusA; StatusString: String; EntryName, DeviceType,
|
||||
DeviceName: array of Char);
|
||||
begin
|
||||
ListBox1.Items.Add(EntryName+' | '+DeviceName+' || '+StatusString);
|
||||
if CheckBox1.Checked then DialUp.HangUpConn(Handle);
|
||||
end;
|
||||
|
||||
procedure TForm1.Button5Click(Sender: TObject);
|
||||
begin
|
||||
DialUp.HangUpConn(ListBox1.ItemIndex);
|
||||
end;
|
||||
|
||||
end.
|
140
DialUp/README.TXT
Normal file
140
DialUp/README.TXT
Normal file
@ -0,0 +1,140 @@
|
||||
(****************************************** |******************************************
|
||||
* RAR, dekompresni komponenta * |* RAR, decompression component *
|
||||
* pro Delphi 3 (32b) * |* for Delphi 3 (32b) *
|
||||
* (c) 1997 BEALsoft * |* (c) 1997 BEALsoft *
|
||||
* v1.0 * |* v1.0 *
|
||||
*________________________________________* |*________________________________________*
|
||||
* !! TATO KOMPONENTA JE ZDARMA !! * |* !! THIS COMPONENT IS FREE !! *
|
||||
****************************************** |******************************************)
|
||||
// Kontakt na autora // Contact to author :
|
||||
// aberka@usa.net, ICQ UIN 2365308, http://jakub.naf.cz/~aberka
|
||||
// BEALsoft BBS, +420-5-<MOMENTALNE NENI / NONE AT THE MOMENT>, 24h
|
||||
// ** Nove telefonni cislo bude umisteno na me webovske stranky **
|
||||
// ** New phone number will be placen on my web pages **
|
||||
|
||||
// Thanx to Davide Moretti for his RAS API header (Some code in this component
|
||||
// was written by him). You can reach him via e-mail: dmoretti@iper.net
|
||||
|
||||
--------------------------------------------------------------------------------
|
||||
--------------------------------------------------------------------------------
|
||||
Nasledujici dokumentace je JEN v anglictine, protoze predpokladam u programatoru
|
||||
znalost anglictiny.
|
||||
|
||||
It is recommended to read the source code, its comments.
|
||||
|
||||
RAS API functions are described in WIN32.HLP (Shipped with 32b Delphi)
|
||||
|
||||
METHODS:
|
||||
=======
|
||||
function Dial : Integer;
|
||||
Dials <ENTRY> connection.
|
||||
Non-zero result means error; OnError event also occurs.
|
||||
|
||||
function GetEntries : Integer;
|
||||
Get available connections
|
||||
Connections are stored in <ENTRIES>. OnEntryGet event occurs
|
||||
|
||||
function GetConnections : Integer;
|
||||
Get active connection
|
||||
Connections are passed thru OnActiveConnection
|
||||
|
||||
function HangUp : Integer;
|
||||
Hangups the connection you dialed with this component
|
||||
|
||||
function HangUpConn(Handle : THRasConn) : Integer;
|
||||
Hangups the connection identified by Handle (OnActiveConnection)
|
||||
|
||||
function CreateEntry : Integer;
|
||||
Creates entry in phonebook and displays edit dialog
|
||||
|
||||
function EditEntry : Integer;
|
||||
Opens edit dialog for <ENTRY>
|
||||
|
||||
function DeleteEntry : Integer;
|
||||
Delete <ENTRY> from phonebook
|
||||
|
||||
function RenameEntryTo(S : String) : Integer;
|
||||
Rename <ENTRY> to <S>
|
||||
|
||||
function SetEntryUserName(Value : String) : Integer;
|
||||
Set new username (<VALUE>) to <ENTRY>
|
||||
|
||||
function SetEntryPassword(Value : String) : Integer;
|
||||
Set new password (<VALUE>) to <ENTRY>
|
||||
|
||||
function RemovePassword : Integer;
|
||||
Remove password from <ENTRY>
|
||||
|
||||
function GetEntryUserName(var Value : String) : Integer;
|
||||
Get username from <ENTRY> to <VALUE>
|
||||
|
||||
function GetEntryPassword(var Value : String) : Integer;
|
||||
Get password from <ENTRY> to <VALUE>
|
||||
|
||||
function StatusString(State: TRasConnState; Error: Integer): String;
|
||||
Get string describing <STATE> and <ERROR>
|
||||
|
||||
function StatusStringCZ(State: TRasConnState; Error: Integer): String;
|
||||
Get Czech string describing <STATE> and <ERROR>
|
||||
|
||||
|
||||
PROPERTIES:
|
||||
===========
|
||||
|
||||
property DialMode (TDialMode ... dmAsync/dmSync)
|
||||
-----------------
|
||||
|
||||
Property describing the mode of dialing.
|
||||
Async dialing means that user will be notified when anything happen
|
||||
by event. See OnAsyncEvent. [onDialing,onError,onAsyncEvent]
|
||||
Sync dialing means that Dial function will exit when dialing finished.
|
||||
Dial function result gives neccessary information. [onDialing,onConnect,onNotConnected]
|
||||
|
||||
property Entry (String)
|
||||
--------------
|
||||
|
||||
Identifies which entry will be processed by Dial,EditEntry,DeleteEntry,
|
||||
GetEntryUserName,...
|
||||
|
||||
property Language (TLanguage ... Czech/English)
|
||||
-----------------
|
||||
|
||||
Choose your language. Used for events with string messages.
|
||||
|
||||
|
||||
EVENTS:
|
||||
=======
|
||||
|
||||
OnEntryGet, procedure (Sender : TObject; EntryName : Array of Char) of Object;
|
||||
----------
|
||||
This event occurs when an Entry was found in phonebook by GetEntris method.
|
||||
|
||||
OnDialing, procedure (Sender : TObject) of object;
|
||||
---------
|
||||
This event occurs when Dial method is executed.
|
||||
|
||||
OnConnect, procedure (Sender : TObject) of object;
|
||||
---------
|
||||
This event occrus when connected with Dial method.
|
||||
^^^^^^^^^^^
|
||||
|
||||
OnNotConnected, procedure (Sender : TObject; ErrorCode : Integer; ErrorMessage : String) of object;
|
||||
--------------
|
||||
This event is called when dialing failed.
|
||||
|
||||
|
||||
OnAsyncEvent, procedure (Sender : TObject; State : TRasConnState; Error : Integer;
|
||||
------------ MessageText : String) of object;
|
||||
This event is called by RAS when dialing in Async mode. Gives information
|
||||
about current process.
|
||||
|
||||
OnError, procedure (Sender : TObject; ErrorCode : Integer; ErrorMessage : String) of Object;
|
||||
-------
|
||||
This event is called when error occur in Dial method etc.
|
||||
|
||||
OnActiveConnection, procedure (Sender : TObject; Handle : THRasConn; Status : TRasConnStatus;
|
||||
------------------ StatusString : String;
|
||||
EntryName, DeviceType, DeviceName : Array of Char) of object;
|
||||
|
||||
This event is called when an active connection was found by GetConnections.
|
||||
Gives neccessary information about found connection.
|
Reference in New Issue
Block a user