Delphi Language Guide Delphi for Microsoft Win32 Delphi for the Microsoft. Net framework



Yüklə 0,84 Mb.
Pdf görüntüsü
səhifə236/294
tarix02.01.2022
ölçüsü0,84 Mb.
#41395
1   ...   232   233   234   235   236   237   238   239   ...   294
DelphiLanguageGuide

Automation Objects (Win32 Only)
An object whose class implements the IDispatch interface (declared in the 
System
 unit) is an Automation object.
Use variants to access Automation objects. When a variant references an Automation object, you can call the object's
methods and read or write to its properties through the variant. To do this, you must include 
ComObj
 in the uses
clause of one of your units or your program or library.
Dispatch Interface Types
Dispatch interface types define the methods and properties that an Automation object implements through IDispatch.
Calls to methods of a dispatch interface are routed through IDispatch's Invoke method at runtime; a class cannot
implement a dispatch interface.
A dispatch interface type declaration has the form
type interfaceName = dispinterface
    ['{GUID}']
    memberList
end;
where ['{GUID}'] is optional and memberList consists of property and method declarations. Dispatch interface
declarations are similar to regular interface declarations, but they cannot specify an ancestor. For example,
type
         IStringsDisp = dispinterface
         ['{EE05DFE2-5549-11D0-9EA9-0020AF3D82DA}']
         property ControlDefault[Index: Integer]: OleVariant dispid 0; default;
         function Count: Integer; dispid 1;
         property Item[Index: Integer]: OleVariant dispid 2;
         procedure Remove(Index: Integer); dispid 3;
         procedure Clear; dispid 4;
         function Add(Item: OleVariant): Integer; dispid 5;
            function _NewEnum: IUnknown; dispid -4;
     end;

Yüklə 0,84 Mb.

Dostları ilə paylaş:
1   ...   232   233   234   235   236   237   238   239   ...   294




Verilənlər bazası müəlliflik hüququ ilə müdafiə olunur ©azkurs.org 2024
rəhbərliyinə müraciət

gir | qeydiyyatdan keç
    Ana səhifə


yükləyin