Чтение онлайн

ЖАНРЫ

Советы по Delphi. Версия 1.4.3 от 1.1.2001

Озеров Валентин

Шрифт:

 if DdeInitialize(Inst, CallBack, 0, 0) = dmlErr_No_Error then begin

ServiceHSz:= DdeCreateStringHandle(Inst, DataEntryName, cp_WinAnsi);

TopicHSz := DdeCreateStringHandle(Inst, DataTopicName, cp_WinAnsi);

for I := 1 to NumValues do

ItemHSz[I] := DdeCreateStringHandle(Inst, DataItemNames[I],cp_WinAnsi);

if DdeNameService(Inst, ServiceHSz, 0, dns_Register) = 0 then

ShowMessage('Ошибка
в процессе регистрации.');

 end;

end;

procedure TForm1.EnterData1Click(Sender: TObject);

{ Активизируем диалог ввода данных и обновляем хранимые данные по окончании ввода.}

var I: Integer;

begin

 if DataEntry.ShowModal = mrOk then begin

with DataEntry do begin

Label6.Caption := S1;

Label7.Caption := S2;

Label8.Caption := S3;

DataSample[1] := StrToInt(S1);

DataSample[2] := StrToInt(S2);

DataSample[3] := StrToInt(S3);

end; { with }

for I := 1 to NumValues do

if Advising[I] then DdePostAdvise(Inst, TopicHSz, ItemHSz[I]);

 end; { if }

end;

procedure TForm1.Clear1Click(Sender: TObject);

{ Очищаем текущую дату. }

var I: Integer;

begin

 for I := 1 to NumValues do begin

DataSample[I] := 0;

if Advising[I] then DdePostAdvise(Inst, TopicHSz, ItemHSz[I]);

 end;

 Label6.Caption := '0';

 Label7.Caption := '0';

 Label8.Caption := '0';

end;

end.

{ *** КОНЕЦ КОДА DDESVRU.PAS *** }

{ *** НАЧАЛО КОДА DDEDLG.DFM *** }

object DataEntry: TDataEntry

 Left = 488

 Top = 132

 ActiveControl = OK

 BtnBorderStyle = bsDialog

 Caption = 'Ввод
данных'

 ClientHeight = 264

 ClientWidth = 199

 Font.Color = clBlack

 Font.Height = -11

 Font.Name = 'MS Sans Serif'

 Font.Style = [fsBold]

 PixelsPerInch = 96

 Position = poScreenCenter

 OnShow = FormShow

 TextHeight = 13

 object Bevel1: TBevel

Left = 8

Top = 8

Width = 177

Height = 201

Shape = bsFrame

IsControl = True

 end

 object OKBtn: TBitBtn

Left = 16

Top = 216

Width = 69

Height = 39

Caption = '&OK'

ModalResult = 1

TabOrder = 3

OnClick = OK

BtnClickGlyph.Data = {

BE060000424DBE06000000000000360400002800000024000000120000000100

0800000000008802000000000000000000000000000000000000000000000000

80000080000000808000800000008000800080800000C0C0C000C0DCC000F0CA

A600000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000

0000000000000000000000000000000000000000000000000000000000000000

Поделиться с друзьями: