COM ActiveX   3GL   4GL

Delphi


Delphi . . . , , . . , . . Windows NT, Windows 9x. Windows . Delphi. Delphi 1.0, , Delphi 2.0, Win32 API.
, Delphi . , RTL-, TAppllcationHandleException. . IUnknown. , .
, Delphi
, .
Delphi, , . Delphi - . Delphi (, Object Pascal) : try .. except try .. finally.
.
, try .. except ( 1.6):

1.6
try
{ };
except
on Exceptionl do {, 1};
on Exception2 do {, 2};
else
{, };
end;


, try, , , except. except . -, , , on. , , , . -, except . . , , , , on Exception do. , else, , except. . , .
( 1.7).

1.7
try
:=10;
b:=0;
c:=a/b;
except
on EZeroDivide do MessageBox(' !');
end;


, , . on .. do. except ( 1.8).

1.8
on < > do <>;

on <>: < >
do <, >


, . () , - - . : Exception. . on .. do , . <>.< >. 1.9.

1.9
try
ScrollBarl.Max := ScrollBarl.Min - 1;
except
on E: EInvalidOperation do
MessageDlg( ' : '- + E.Message, mtlnformation, [mbOK], O)
end;


EInvalidOperation . E.Message, Delphi ( ).


. . , .

, , . , , - , . , , . , . raise. 1.10.

1.10
try
{ }
except
on < > do
begin
{ }
raise; //
end;
end;


, , raise, , .
, try , HandleException. . , 1.11.

1.11
try
{ } except
Application.HandieException(Self);
end;


try .. finally , finally , - try. 1.12.

1.12
try
{, };
finally
{ , };
end;


, , finally, , . try , finally. , , try , finally . finally , . try .. finally , , . , , , Windows .
try .. except .. end try .. finally .. end. (. 1.24, ).
Delphi , , , . (silent exceptions). EAbort. VCL Delphi , EAbort.


EAbort.

, Abort. EAbort, . . (ListBoxi) (Button1). onclick :

1.13
procedure TForml.ButtonlClick(Sender: TObject);
var
I: Integer;
begin
for I := 1 to 10 do ( 10 }
begin
ListBoxl.Items.Add(IntToStr(I)); { }
if I = 7 then Abort; { }
end;
end;


, Button1, 1 7.

 1.24
. 1.24. () ()
RTL-.
RTL (real time library)- Delphi sysutils Exception.
- RTL (. 1.1).
1.1. RTL




/

/

/ , Windows






: , , .



. : , , .

s

as




(IntToStr, StrToInt .)



, , : ,

Variant


Variant

,

Variant


. :

Exception

-

EAbort

-

EAbstractError

-

EAccessViolation

-

EArrayError

-

EAssertionFailed

-

EBitsError

- TBits

ECacheError

-

EComponentError

-

EControlC

- <Ctrl>+<C>

EConvertError

- ()

EDatabaseError

-

EDBClient

-

EReconcileError

-

TClientDataset

EDBEngineError

- BDE

ENoResultSet

- TQuery select

EUpdateError

- TProvider

EDateTimeError

-

EDimensionMapError

-

EDimlndexError

-

EExternalException

-

EInOutError

- /

EIntError

-

EDivByZero

-

ERangeError

-

EIntOverflow

-

EIntfCastError

- as

EInvalidGraphic

-

EInvalidGraphicOperation

-

EInvalidGridOperation

- (Grid)

EInvalidOperation

-

EInvalidPointer

-

EListError

-

ELowCapacityError

-

EMathError

-

EInvalidArgument

-

EInvalidOp

-

EOverflow

-

EUnderflow

-

EZeroDi'vide

-

EMCIDeviceError

- MCI (Media Control Interface)

EMenuError

-

EOleCtrlError

- ActiveX

EOleError

- OLE

EOleSysError

- OLE IDispatch

EOleException

- OLE,

EOutlineError

- Tout line

EOutOfMemory

-

EOutOfResources

- Windows

EPackageError

- ,

EParserError

-

EPrinter

-

EPrivelege

- -

EPropReadOnly

- OLE ,

EPropWriteOnly

- OLE ,

EPropertyError

-

ERegistryException

- Windows

EReportError

- ( TReport )

EResNotFound

- (*.DFM *.RES)

EStackOverflow EStreamError

- -

EFCreateError

-

EFOpenError

-

EFilerError

-

EReadError

-

EWriteError

-

EclassNotFound

-

Elnvalidlmage

-

EmethodNotFound

-

EStringListError

-

EThread

-

ETreeViewError

- TTreeview

EVariantError

- variant

EWin32Error

- Windows


, Exception Delphi. Exception. Exception . Delphi . , Exception TObject, .
, , . , ( ).

, , .
Delphi, nporfro, . , , Exception Exception.
:
type
EMyException = class(Exception);
, EMyException, , Exception. Exception , .
raise. :
type
EPasswordlnvalid = class (Exception);
EpasswordInwalid :
if Password <> CorrectPassword then raise EPasswordlnvalidCreate(' ');
.

Delphi interface . VCL,
, - . , , , .
, - .
() CORBA.
, . , , . . , , , . , iMalloc , . , IPersist , , . ( 1.14):

1.14
type
IEdit = interface
procedure Copy; stdcall;
procedure Cut; stdcall;
procedure Paste; stdcall;
function Undo: Boolean; stdcall;
end;




, , , .

. , . , , ( 1.15).

1.15
TEditor = class(TInterfacedObject, lEdit)
procedure Copy; stdcall;
procedure Cut; stdcall;
procedure Paste; stdcall;
function Undo: Boolean; stdcall;
end;


, , -. , - , . ., , , nil, , .
IUnknown
, TObject, - IUnknown. System ( 1.16):

1.16
type
IUnknown = interface
['{ 00000000-0000-0000-000-000000000046}']
function Querylnterf(const IID: TGUID; out Obj): Integer; stdcall;
function _AddRef: Integer; stdcall;
function _Release: Integer; stdcall;7
end;


. , (Global Unique Identifier, GUID).
GUID - 128- , . 128- , GUID . , , GUID . GUID ( , . .). , API CocreateGUID (), TGUID. :
'{----}'
, , , GUID. - (Interface ID, IID), - (Class ID, CLSID).
GUID Delphi <Ctrl>+<Shift>+<G> .
, lunknown , :
- QueryInterface() - , , . , , object, interface1, interface2 . interface2, Object, Interface2.Query Interface ;
- _AddRef () - , . _AddRef() _Release ();
- _Release () - .
, CORBA.
lunknown , ActiveX.
TlnterfacedObject
VCL Delphi TlnterfacedObject, . Delphi system ( 1.17):

1.17.
type
TlnterfacedObject = class(TObject, IUnknown) private
FRefCount: Integer;
protected
function Querylnterface(const IID: TGUID; out Obj): Integer; stdcall;
function _AddRef: Integer; stdcall;
function _Release: Integer; stdcall; public
property RefCount: Integer read FRefCount;
end;


, TObject lunknown. Tinterfacedobject , . ,
type
TMyObjInterfaced = class(TInterfacedObject, IPaint)
end;

TMyObj interfaced, Tinterfacedobject IPaint.
as
, , as . ,
procedurePaintObjecta(P: TInterfacedObject) var
X: IPaint; begin
X := P as IPaint;
{}
end;

Tinterfacedobject. , IPaint.. Querylnterface, IUnknown . , . , .

:= as IPaint;
.
as :
- , lunknown. s;
- as , IID. , IID , , <Ctrl>+<Shift>+<G>.
implements
VCL Delphi . , . , , implements , . , implements . , , .
1.18 implements , RGB.

1.18
unit cadapt;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs;
type
IRGBSbit = interface
['{Id76360a-f4f5-lldl-87d4-00c04fbl7199}']
function Red: Byte;
function Green: Byte;
function Blue: Byte;
end;
IColorRef = interface
[41d76360b-f4f5-lldl-87d4-00c04fbl7199}'] function Color: Integer; end;
TRGBSColorRefAdapter = class(TInterfacedObject, IRGBSbit, IColorRef) private
FRGBSbit: IRGBSbit;
FPalRelative: Boolean; public
constructor Create(rgb: IRGBSbit);
property RGBSIntf: IRGBSbit read FRGBSbit implements IRGBSbit;
property PalRelative: Boolean read FPalRelative write-FPalRelative;
function Color: Integer; end;
implementation
constructor TRGBSColorRefAdapter.Create(rgb: IRGBSbit);
begin
FRGBSbit := rgb; end;
function TRGBSColorRefAdapter.Color: Integer;
begin
if FPalRelative then
Result := PaletteRGB(RGBSIntf.Red, RGBSIntf.Green, RGBSIntf.Blue) else
Result := RGB(RGBSIntf.Red, RGBSIntf.Green, RGBSIntf.Blue);
end;
end.



CORBA ( ). Delphi , TInterfacedObject.
(CLSID). CLSID. , CLSID . , , , CoClasses. CoClasses Querylnterface . -. , .
CORBA ( , Common Object Request Broker Architecture). , , . , CORBA, Windows 98, UNIX.

  COM ActiveX   3GL   4GL

, , Sequence diagram - - , . .
{DATA}




 18.01.2021 - 11:33: - Personalias -> WHO IS WHO - - _.
18.01.2021 - 09:05: , - War, Politics and Science -> . - _.
18.01.2021 - 08:21: , , - Upbringing, Inlightening, Education -> - _.
18.01.2021 - 07:41: , , - Upbringing, Inlightening, Education -> - _.
17.01.2021 - 17:59: , - War, Politics and Science -> - _.
17.01.2021 - 16:46: , , - Upbringing, Inlightening, Education -> - _.
17.01.2021 - 16:00: - Ecology -> - _.
16.01.2021 - 08:30: - Conscience -> . ? - _.
15.01.2021 - 09:03: , - War, Politics and Science -> - _.
15.01.2021 - 09:03: , , - Upbringing, Inlightening, Education -> - _.
15.01.2021 - 08:20: - Theorizing and Mathematical Design -> - - _.
15.01.2021 - 08:19: , , - Upbringing, Inlightening, Education -> - _.
Bourabai Research -  XXI Bourabai Research Institution