Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- unit ruflightu;
- interface
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- StdCtrls, DdeMan;
- type
- TitelArray = Array[1..5] of Byte;
- PDLLEintrag = ^TDLLEintrag;
- TDLLEintrag = Packed Record
- Markiert : Boolean;
- Titel : TitelArray;
- Adel : Byte;
- NameVorsatz : Byte;
- NameZusatz : Byte;
- Geschlecht : Byte;
- Vorname : String[30];
- Anrede : String[10];
- Name : String[120];
- Zusatz : String[120];
- Ortsteil : String[40];
- Strasse : String[46];
- Hausnummer : String[10];
- HausnummerZusatz : String[20];
- Land : String[3];
- PLZ : String[5];
- Ort : String[70];
- Vorwahl : String[10];
- TelZusatz : String[15];
- Telefon : String[20];
- end;
- PDLLArray = ^TDLLArray;
- TDLLArray = Array[1..1] of TDLLEintrag;
- TUseVersion = procedure(V : Byte); stdcall;
- TSucheTelefonnummer = procedure( Nummer : PChar; var EintragListe : PDLLEintrag;
- var EintragAnzahl : LongInt ); stdcall;
- TForm1 = class(TForm)
- Button1: TButton;
- Edit1: TEdit;
- ListBox1: TListBox;
- RadioButton1: TRadioButton;
- RadioButton2: TRadioButton;
- procedure Button1Click(Sender: TObject);
- procedure RadioButton2Click(Sender: TObject);
- procedure RadioButton1Click(Sender: TObject);
- private
- { Private-Deklarationen }
- DllHdl : THandle;
- public
- { Public-Deklarationen }
- end;
- var
- Form1 : TForm1;
- DllHdl : THandle;
- FuncPtr : TFarProc;
- PSucheTelefonnummer : TSucheTelefonnummer;
- PUseVersion : TUseVersion;
- implementation
- {$R *.DFM}
- procedure TForm1.Button1Click(Sender: TObject);
- var
- EList : PDLLEintrag;
- ETemp : PDLLArray;
- ECount : LongInt;
- co : LongInt;
- begin
- PSucheTelefonnummer( PChar( Edit1.Text ), EList, ECount );
- ETemp := PDLLArray( EList );
- for co := 1 to ECount do begin
- ListBox1.Items.Add( ETemp^[co].Name + #32 + ETemp^[co].Vorname + #32 +
- ETemp^[co].Vorwahl + '-' + ETemp^[co].Telefon );
- end;
- end;
- procedure TForm1.RadioButton2Click(Sender: TObject);
- begin
- PUseVersion( 2 );
- end;
- procedure TForm1.RadioButton1Click(Sender: TObject);
- begin
- PUseVersion( 1 );
- end;
- initialization
- DllHdl := 0;
- FuncPtr := Nil;
- DllHdl := LoadLibrary( 'rufid.dll' );
- if DllHdl = 0 then
- Halt;
- FuncPtr := GetProcAddress( DllHdl, 'SucheTelefonnummer' );
- if FuncPtr = nil then
- Halt
- else
- @PSucheTelefonnummer := FuncPtr;
- FuncPtr := GetProcAddress( DllHdl, 'UseVersion' );
- if FuncPtr = nil then
- Halt
- else
- @PUseVersion := FuncPtr;
- end.
Advertisement
Add Comment
Please, Sign In to add comment