Разработка приложений в системе Delphi. Шейкер Т.Д. - 164 стр.

UptoLike

Составители: 

uses Windows;
procedure BeepMe; stdcall;
begin
MessageBeep (0);
end;
Exports
BeepMe index 1 name 'BeepMe';
begin
end.
Приложение
unit SoundForm; // Модуль формы
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
StdCtrls; Dialogs,
procedure BeepMe; stdcall; external 'Beeper';
type
TForm1 = class(TForm)
Button1: TButton;
procedure Button1Click(Sender: TObject);
end;
var
Form1: TForm1;
implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
BeepMe;
end;
end.
program SoundApp; // Файл проекта
uses
Forms,
SoundForm in 'SoundForm.pas' {Form1};
{$R *.RES}
begin
Application.Initialize;
Application.CreateForm(TForm1, Form1);
A
end.
pplication.Run;
Пример 3. Библиотека Beeper. Статический импорт с интерфейсным
модулем
Приложение
unit SoundUnit; // Интерфейсный модуль
164
uses Windows;
procedure BeepMe; stdcall;
begin
  MessageBeep (0);
end;
Exports
  BeepMe index 1 name 'BeepMe';
begin
end.

    Приложение
unit SoundForm;    // Модуль формы
interface
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls;
procedure BeepMe; stdcall; external 'Beeper';
type
  TForm1 = class(TForm)
    Button1: TButton;
    procedure Button1Click(Sender: TObject);
  end;
var
  Form1: TForm1;

implementation
{$R *.DFM}
procedure TForm1.Button1Click(Sender: TObject);
begin
BeepMe;
end;
end.

program SoundApp;    // Файл проекта

uses
  Forms,
  SoundForm in 'SoundForm.pas' {Form1};

{$R *.RES}

begin
  Application.Initialize;
  Application.CreateForm(TForm1, Form1);
  Application.Run;
end.


Пример 3. Библиотека Beeper. Статический импорт с интерфейсным
модулем
    Приложение
unit SoundUnit;     // Интерфейсный модуль


                                  164