           21 

       ActiveX 

      

     ,   ActiveX,     
  , -    ,  
 Microsoft     : Microsoft  
  ActiveX   ,    
.   OLE      . Microsoft 
   OLE,      
  -   OLE.    
    ActiveX,     
   ,        
  .    ActiveX   . 

      ActiveX ( ). 
       (   ). 
       ActiveX. 
      ActiveForm (   ActiveX). 
      . 

    --    
       DAX,     
 ActiveX   ActiveForm, a     
  OLE  Delphi 3. 
    --    
      interface, Diaplnterface, Enum  codass  
,         (Type 
Library Editor). 
    ---    ActiveX 
        ActiveForm   
 Delphi ActiveForm. 
    --    ActiveX   ActiveForm  Web 
         ActiveX   
ActiveForm   Web.     Delphi  
  . 

      Delphi ActiveX (DAX) 

          ActiveX , 
    ,     

490

         ActiveX  OLE.  
Delphi  ,       Windows, 
  TWinControl,      
^^  ^1,1-     
 ActiveX,      ,   
Visual Basic. 
        Delphi   Delphi 
ActiveX (DAX).     ,   
,  ,   ActiveX,  ActiveForm  
 .      DAX. 

     ActiveX   DAX 

         DAX,    
,   ,  ,   
ActiveX   ActiveForm. 

    TComObject 
    TTypedComObj ect 
    TAutoObject 
    TActiveXControl 
    TCustomForm 
    TActiveForm 

     TCustomForm   TForm      
TActiveForm,    TCustomForm     ,  
  ActiveX. 

        DAX 

       DAX   ,    
        
   .     
,        
  ,     
    .       
  ActiveX     .   
        ,     
       
    .    ,  Delphi 
     .    
,       Delphi. 

    TCustomForm 
    TPropertyPage     
    TActiveXPropertyPage 
    [TMyProperty Page] 
             TPropertyPage. 

        DAX 

    Delphi   ()    
   (factories) ,   
    Delphi  Server (ComServer),    
ComServ.   Delphi        
 ,   .    
    ,   ,  
   ,       

    TComObj ectFactory 
    TActiveXPropertyPageFactory 
    TTypedComObj ectFactory 
    TAutoObjectFactory     
    TActiveXControlFactory 
    TActiveFormFactJory 

     TActiveXControlFactory  TActiveFormFactory   
   ActiveX   ActiveForm.  TComObj 
ectFactory    18, "  OLE,    
  ActiveX",    ,   TAutoObj 
ectFactory     ,  
   20, " OLE". 

     21.    ActiveX                           491 

        ?    IClassFactory, 
       ,  
    .     
       Windows   
   . ,  TActiveXControlFactory    
   ActiveX    . 
        Delphi,   
 ActiveX,   Delphi    ActiveX. 
   ,      ,   . 
   ,      ,  
   Delphi    ,   
   DAX.     , 
,   .. ,     
  ActiveX,  ,        
    (Type Library Editor) Delphi. 
    -  |  .     
,     ,       
"  ActiveX",    " "  
   . 

      

          OLE,    
   ,   ActiveX   
.     ,    . 
            
     ,    
.      ActiveX   
 Delphi         TLB, 
       DLL  . 
             
 Delphi  ,      ActiveX,  
ActiveForm,    .. 

       

       Delphi     
  .      
Object List (. 21.1),      , 
     .    
  ,      . 
 Object List      .   
  ,    Object List,     
    . ,    
Attributes, Members  Uses. 
            
View^Type Library.    ,    
,    File^Open.     File of type 
  Type Library (*.tlb;*.dll;*.ocx;*.exe;*.olb),   
 ,      . 
           .   
  . 

        

        ,   ,  
  .       Object List (. 
. 21.1),          
: Attributes  Uses.       
Attributes  Uses    . 

     Attributes     

      Attributes ()     
  .        
 ,    Object List     (. 
. 21.1).  . 21.1   ,   . 21.2    
 . 

    492                                            V.   OLE 


    . 21.1.      


     21.1.    

                

    Name	   

    QUID	  128-    
    Version	  ,    .,     
     .        
  .         
   0  65 535 
    LCID	   (locale),    
,             
    Help String	  .   
       
    Help File	  ,     
    Help Context	     


     21.2,                                          

                  

    None	   
    Restricted	      
 ,   Visual Basic 
    Control	,     ,  
           
   (CoClass) 
    Hidden	,   ,       
  
     Uses     
      Uses   ,    
 .         
  ,     .  
       
 . ,  

     21.    ActiveX                           493 

          IDispatch,  
^.&.  j<oneco,   Delphi   
    STDOLE32.TLB,     
IDispatch.  STDOLE32 . TLB     Windows. 
        Uses    .   
 ,    ,    GUID, 
      Windows. 

     (Enum)    

             
 Object Pascal.         
,          
 1^5!'" .  ,     
       
ActiveX   .     
   Attributes  Members   . 

     Attributes    

     . 21.2   (Enum),     
  Delphi   Attributes     .  
. 21.3    ,     . 

    . 21.2.      

     21.3.      

                

    Name	  
    GUID	128-  GUID- 
    Help String	  .   
       
    Help Context	     
    Version	  ,    .,     
     .        
  .         
   0  65 535 

    494  V.   OLE 


     Members    

      Members   ,  . 
    . 

    < > =  >; 
    helpstring = ' '; 

           
,   ,    ,   
  .  . 21.3   Members  . 

    . 21.3.       


     Interface  Displnterface    

              
.         
_,      OLE I 
Dispatch,         
   DispID.  Displnterface  
,         IDispatch. 
  (dual interface)   ,     
 JI    ,    IDispatch.  
      Attributes  
Members   " 

     Attributes    

     . 21.4  ,      
,   Attributes     .  . 21.4 
   ,      
,   . 21.5   ,    . 

     21.4.                          

                

    Name	  
    GUID	128-  GUID- 
    Help String	  .   
       
    Help Context	     


     21.    ActiveX 495 


     . 21.4 

                

    Version	  ,    . ,    
      .      
    .       
     0  65 535 
    Parent Interface	 ,     
 .       Displnterface 

    . 21.4.       

     21.5.      

                  

    Displnterface	     ,   
      Invoke  Idispatch 
    Hidden	,   ,       
 - 
    Nonextensible	,    IDispatch  
    ,      
    Dual	,        
 IDispatch     
    OLE Automation	,      
    .   Displnterface   
 ,          
     Members    
     Members        
,    .    , 
         Object 
Pascal.     ,      
    

    496                                            V.   OLE 

       DispID.   Di5pID   1  
  1    .    
  readonly  writeonly,      
  .       . 

    property FrameCount: Integer; readonly; dispid 1; 
    property Play(FromFrame, ToFrame: Smallint; Count: Integer); dispid 2; 
    property OpenDatabase[DatabaseName, TableName, UserName, 
    Password : WideString]: WordBool; dispid 3; 

           
 .          
  ,   ,    ActiveX  
    .  . 21.5  
 Members       Delphi. 

    . 21.5.       

          Displnterface,   
         
  OLE  .   OLE    
: Byte, Smallint, Integer, Single, Double, Currency, TDateTime, 
WideString, WordBool  OleVariant.      
     OleVariant,    20, 
" OLE". 

     Attributes       

     . 21.6   ,     
 ,   Attributes     .  . 
21.6   ,      
,   . 21.7    . 

     21.6,       

                

    Declaration	    

    ID	  DispID 
    Help String	     
    Help Context	       
    
     21.    ActiveX 497 

    . 21.6.      

    I  21.7.                      

                  

    Restricted	      
 ,   Visual Basic 
    Source	,        VARIANT, 
   
    Biddable	,     (binding)  
    Request Edit	,     OnRequestEdit 
    Display Bindable	,       
    (bindable) 
    Default Bindable	      
,      
    Hidden	,   ,       
  


      (CoClass)    

         (CoClass)    
 ActiveX,      .  
    ,   
 .       
 Attributes  Members       
 . 

     Attributes      

     . 21.8   ,   . 21.9  ,  
    . 

     21.8.       

                

    Name	   (15) 
    GUID	 128-  GUID   (CoClass) 
    Help String	   .   
       


    498  V.   OLE 


     . 21.8 

                

    Help Context	      
    Version	  ,    .,   .  
          
  	         
.     0  65 535 
    
     21.9.                        

                 

Licensed	,        
.       ActiveX
Control	,       
Application Object	,       
(out-of-process)  ().      


     Members     

      Members         
  ,    .   
   . 
        ,     . 
      GUID   ,   
 . 
     ,       . 
     ,       
,     ,   Word 
Basic, Visual Basic, D.el.phi.^.Qbject PAL  Excel Basic.       -
    ! ,        
  ,   Word Basic, Visual Basic, Delphi, 
Object PAL  Excel Basic. 
            ,   
      Members.     
,      Insert Interface  Remove Interface.  
       Source, Default  
Restricted.          
,      . 

      ActiveX 

            
ActiveX. ,    ActiveX     
ActiveX      Delphi    VCL. 
     ActiveX  Microsoft    , 
        
Internet,    \Vorld Wide Web.  ,   : 
    "^^,    ActiveX   ?".   
     ,   
._1)< , Delphi,, ..    ,  
Borland C++ Builder. Visual C++  Visual Basic?  ActiveX 
   . 
       , Delphi     DAX 
   TWinControl    ActiveX.  
 ,       
 ActiveX,   Delphi. 
    I Borland Delphi  2  3. 
     Borland C++Builder. 
     Borland Paradox 8. 
    E Borland IntraBuiIder. 


     21.    ActiveX                           499 


     Microsoft Visual C++. 
     Microsoft Visual Basic  4  5. 
     Microsoft Internet Explorer 3.01. 
     Microsoft ActiveX Control Pad. 
     Microsoft Frontpage. 
       ActiveX    . 
    1.   VCL       
Delphi      TWinControl.    
 ActiveX,   TGraphicControl,    
     TCustomControl.     
,     . 
    2.  MacTecia.ActiyeX Control,   File^New   
   ActiveX Control   ActiveX.    
  VCL,      ActiveX,  
  ActiveX,      , 
  ..     OK Delphi     
 ,   public  published,   . 
     :      
    (,   ..),   
    ,    . 
    3.      Delphi     
    ,      
,   ,    ,    
  Object Pascal.   ,   
  ,    ActiveX . 
  ,   .      
(   View^Type Library),     
   Refresh     ,  
 Delphi  . 
    4.     Get  Set,     
     ,    
 .      . 
    5.  , ,       
.  ,   -   ;  ,   
 ,    ,   
        . 
 ,  ,   
    LHOBHyro  . Delphi    
    , ,    
 Delphi. 
    6.     . 
    7. -      ,  
  ActiveX,    Delphi. 

       ActiveX - PieX 

           ActiveX  
  .         
ActiveX     Delphi TPie.      
TPie,   ,      TGraphicControl  
       ActiveX . 
      TGraphicControl.   ,  
    TPie       
TCustomControl   TGraphicControl,  TPie   
      ActiveX. 
           PIES.    
\DEMOS\PROPEDIT\     TPie  TCustomControl. 
     ,    TPie    
 ActiveX Control. 
                
   PIES. PAS ( Project^Options,  
Directories/Conditionals,  Search path). 

    500                                            V.   OLE 

        TPie    Delphi,  
       ActiveX.    
 File^Open    File of type   Open  
 Delphi package source (*.dpk).      . . 
\DEMOS\PROPEDIT\      PIELIB. DPK.    
    (Package Editor) Delphi. 
       Install,     .  
TPie    Samples,    Delphi.    
   ,        
   ActiveX.       
  TPie,        . 

      ActiveX Control 

       ActiveX Control,    File^New  
     ActiveX Control  ActiveX (. 21.7). 
             
VCL,       ActiveX.   VCL 
Class Name   TPie (. 21.8). 

    . 21.7.   ActiveX Control 

    , 21.8.   TPie   ActiveX Control,  
      ActiveX 

      TPie     Samples    
Delphi, ,     PIES.      
 PIELIB. DPK.      ,  
 ,     ,      
   .   Include Design-time 
License,      . 
       ,  Delphi      
(public)   (published) ,     
TPie.  Brush  Pen      ' 'SctiveX,  
   .  Delphi    
(PieXControl. dpr),   (PieXIrnpl .),   
(PieXControl. tib)    (PieXControl. lie).  , Delphi 
  (PieXControlLib. ),     
   .       uses   
     ActiveX. 

        

     ,     PieXControl.  
      ,    
 View=>Type Library.  . 21.9     
 PieXControl. 

     . 21.10      PieXControl. 

     21.    ActiveX                           501 


     21.10.     PieXControl 

                

    PieXControlLib ,     
    IpieX ,      TPie,  
  
    IpieXEvents , ,  
.  TPie 
    PieX   (CoClass),    PieX  PieXEvents 
    TxMouseButton ,     

    . 21.9.    pieXControl 

      Members  IPieX, ,     
 TPie  .  ,   
   .    
         ,  
       TPie. 
        
         ,  ,   
     IPieX    Members 
 .      .   
      . 

    property EndAngle: Integer; dispid 5; 
    property StartAngle: Integer; di5pid 6; 
    property BrushColor: Integer; dispid 7; 
    property PenColor: Integer; dispid 8; 

      ,      
 TPie Angle. StartAngle, Angle . EndAngle, Brush. Color  Pen 
.Color. ,      
DispID,    5.       
  . 

     
       DispID    
 .     
 Windows. 


    502  V.   OLE 

            Refresh, 
      .   
Delphi      Pielmpi. . 
        ,   Delphi   
PieXControl (    ).    
PIEXCONTROLLIB. . ,        
.   (TLB)    ,     
 .    PieXControlLib.pas  ,   
   ( 21.1). 

     21.1. \UDELPHl3\CHP2l\PlEXCONTROLLlB. PAS.  
,     DAX     

    unit PieXControlLib; 
    { PieXControlLib Library } 
    { Version 1.0 } 
    interface 
    uses Windows, ActiveX, Classes, Graphics, OleCtrls, StdVCL; 
    const 
    LIBID_PieXControlLib: TGUID = '{88DAF8EO-5AA5-11DO-A45E-444553540000 } ' ; 
    const 
    { MouseButton } 
    mbLeft = 0; 
    mbRight = 1; 
    mbMiddle = 2; 
    const 
    {  GUID  . } 
    Class_PieX: TGUID = '(88DAF8E3-5AA5-11DO-A45E-444553540000}'; 
    type 
    {  . } 
    IPieX = interface; 
    DPieX = dispinterface; 
    IPieXEvents = dispinterface; 
    PieX = IPieX; 
    MouseButton = TOleEnum; 
    (  Dispatch   PieX. } 
    IPieX = interface(IDispatch) 
    ['{88DAF8E1-5AA5-11DO-A45E-444553540000}'] 
    procedure Paint; safecall; 
    function Get Visible: WordBool; safecail; 
    procedure Set_Visible(Value: WordBool); safecall; 
    function Get Enabled: WordBool; safecall; 
    procedure Set Enabled(Value: WordBool); safecall; 
    function Get Cursor: Smallint; safecall; 
    procedure Set Cursor(Value: Smallint); safecall; 
    function Get_EndAngle: Integer; safecall; 
    procedure Set_EndAngie(Value: Integer); safecall; 
    function Get StartAngle: Integer; safecall; 
    procedure Set StartAngle(Value: Integer); safecall; 
    function Get_BrushColor: Integer; safecall; 
    procedure Set_BrushColor(Value: Integer); safecall; 
    function Get_PenColor: Integer; safecall; 


     21.    ActiveX                           503 


    procedure Set_PenColor(Value: Integer); safecall; 
    property Visible: WordBool read Get_Visible write Set_Visible; 
    property Enabled: WordBool read Get_Enabled write Set_Enabled; 
    property Cursor: Smallint read Get_Cur5or write Set_Cursor; 
    property EndAngle: Integer read Get_EndAngle write Set_EndAngle; 
    property StartAngle: Integer read Get_StartAngle write Set_StartAngle; 
    property BrushColor: Integer read Get_BrushColor write Set_BrushColor; 
    property PenColor: Integer read Get_PenColor write Set_PenColor; 
    end; 
    (     IPieX  Dual. } 
    DPieX  = dispinterface 
    ['{88DAF8E1-5AA5-11DO-A45E-444553540000}'] 
    procedure Paint; dispid 1; 
    property Visible: WordBool dispid 2; 
    property Enabled: WordBool dispid 3; 
    property Cursor: Smallint dispid 4; 
    property EndAngle: Integer dispid 5; 
    property StartAngle: Integer dispid 6; 
    property BrushColor: Integer dispid 7; 
    property PenColor: Integer dispid 8; 
    end; 
    {     PieX. } 
    IPieXEvents = dispinterface 
    ['{88DAF8E2-5AA5-11DO-A45E-444553540000}'] 
    procedure OnClick; dispid 1; 
    procedure OnDblClick; dispid 2; 
    end; 
    {   ActiveX PieXControl. } 
    TPieX = class(TOleControl) private 
    FOnClick: TNotifyEvent; 
    FOnDblClick: TNotifyEvent; 
    FIntf: IPieX; 
    protected 
    procedure InitControlData; override; 
    procedure InitControlInterface(const Obj: lUnknown); override; 
    public 
    procedure Paint; 
    property Controllnterface: IPieX read FIntf; 
    published 
    property TabStop; 
    property Align; 
    property DragCursor; 
    property DragMode; 
    property ParentShowHint; 
    property PopupMenu; 
    property ShowHint; 
    property TabOrder; 
    property OnDragDrop; 
    property OnDragOver; 
    property OnEndDrag; 
    property OnEnter; 
    property OnExit; 
    property OnStartDrag; 
    property Visible: WordBool index 2 read GetWordBoolProp 
    write SetWordBoolProp stored False; 
    property Enabled: WordBool index 3 read GetWordBoolProp 
    write SetWordBoolProp stored Falser
    property Cursor: Smallint index 4 read GetSmallintProp 


    504                                            V.   OLE 


    write SetSmallintProp stored False; 
    property EndAngle: Integer index 5 read GetIntegerProp 
    write SetIntegerProp stored False; 
    
    property StartAngle: Integer index 6 read GetIntegerProp 
    write SetIntegerProp stored False; 
    
    property BrushColor: Integer index 7 read GetIntegerProp 
                         write SetIntegerProp stored False; 
    
    property PenColor: Integer index 8 read GetIntegerProp 
                         write SetIntegerProp stored False; 
    
    property OnClick: TNotifyEvent read FOnClick write FOnClick; 
    
    property OnDblClick: TNotifyEvent read .FOnDblClick 
                         write FOnDblClick; 
    end; 
    procedure Register; 
    implementation 
    uses ComObj ; 
    procedure TPieX.InitControlData; 
    const 
    CEventDispIDs: array[0..1] of Integer = ( 
    $00000001, $00000002); 
    CLicenseKey: array[0..38] of Word = ( 
    $007B, $0038, $0038, $0044, $0041, $0046, $0038, $0045, $0035, $002D, 
    $0035, $0041, $0041, $0035, $002D, $0031, $0031, $0044, $0030, $002D, 
    $0041, $0034, $0035, $0045, $002D, $0034, $0034, $0034, $0035, $0035, 
    $0033, $0035, $0034, $0030, $0030, $0030, $0030, $007D, $0000); 
    CControlData: TControlData = ( 
    ClassID: '{88DAF8E3-5AA5-11DO-A45E-444553540000}' ; 
    EventIID: '{88DAF8E2-5AA5-11DO-A45E-444553540000}' ; 
    EventCount: 2; 
    EventDispIDs: QCEventDispIDs; 
    LicenseKey: @CLicenseKey; 
    Flags: $00000000; 
    Version: 300; 
    FontCount: 0; 
    FontIDs: nil); 
    begin 
    ControlData := @CControlData; 
    end; 
    procedure TPieX.InitControlInterface(const Obj: lUnknown) ; 
    begin 
    FIntf := Obj as IPieX; 
    end; 
    procedure TPieX.Paint; 
    begin 
    Controllnterface.Paint; 
    end; 
    procedure Register; 
    begin 
    RegisterComponents('ActiveX', [TPieX]) ; 
    end; 
    end. 
    ,      ,    
MouseButton   .    PieX,   
     ActiveX. ,    
   Delphi   Get  Set.   
  IPieXEvents.  ,  , 
     DispID   . 

     21.    ActiveX                           505 

         ActiveX    
Pielmpi.pas ( 21.2).      
  Get  Set,   . 

    function TPieX.Get_EndAngle: Integer; safecall; 
    begin 
    Result := FDelphiControl-Angles.EndAngle;; 
    end; 
    procedure TPieX.Set EndAngle(Value: Integer); safecall; 
    begin 
    FDelphiControl.Angles.EndAngle := Value; 
    end; 
    function TPieX.Get_StartAngle: Integer; 
    begin 
    Result := FDelphiControl.Angles.StartAngle; 
    end; 
    procedure TPieX.Set_StartAngle(Value: Integer); 
    begin 
    FDelphiControl.Angles.StartAngle := Value; 
    end; 
    function TPieX.Get_BrushColor: Integer; safecall; 
    begin 
    Result := FDelphiControl.Brush.Color; 
    end; 
    procedure TPieX.Set BrushColor(Value: Integer); safecall; 
    begin 
    FDelphiControl.Brush.Color := Value; 
    end; 
    function TPieX.Get PenColor: Integer; safecall; 
    begin 
    Result := FDelphiControl.Pen.Color; 
    end; 
    procedure TPieX.Set PenColor(Value: Integer); safecall; 
    begin 
    FDelphiControl.Pen.Color := Value; 
    end; 

     21.2. \UDELPHl3\CHp2l\PlElMpL. PAS.    
  Get  set,    PIEXCONTROLLIB . PAS 

    unit Pielmpi; 
    interface 
    uses 
    Windows, ActiveX, Classes, Controls, Graphics, Menus, Forms, StdCtrls, 
    ComServ, AxCtrls, PieXControlLib, Pies; 
    type 
    TPieX = class(TActiveXControl, IPieX) 
    private 
    { Private declarations } 
    FDelphiControl: TPie; 
    FEvents: IPieXEvents; 
    procedure ClickEvent(Sender: TObject) ; 
    procedure DblClickEvent(Sender: TObject); 
    protected 
    { Protected declarations } 


    506                                            V.   OLE 


    procedure InitializeControl; override; 
    procedure EventSinkChanged(const EventSink: lUnknown); override; 
    procedure DefinePropertyPages ( 
    DefinePropertyPage: TDefinePropertyPage); override; 
    function Get BrushColor: Integer; safecall; 
    function Get_Cursor: Smallint; safecall; 
    function Get Enabled: WordBool; safecall; 
    function Get_StartAngle: Integer; safecall; 
    function Get_EndAngle: Integer; safecall; 
    function Get Visible: WordBool; safecall; 
    function Get PenColor: Integer; safecall; 
    procedure Paint; safecall; 
    procedure Set BrushColor(Value: Integer); safecall; 
    procedure Set Cursor(Value: Smallint); safecall; 
    procedure Set Enabled(Value: WordBool); safecall; 
    procedure Set_EndAngle(Value: Integer); safecall; 
    procedure Set_StartAngle(Value: Integer); safecall; 
    procedure Set PenColor(Value: Integer); safecall; 
    procedure Set Visible(Value: WordBool); safecall; 
    end; 
    implementation 
    uses PieAngle, PieColors; 
    { TPieX } 
    procedure TPieX.InitializeControl; 
    begin 
    FDelphiControl := Control as TPie; 
    FDelphiControl.OnClick := ClickEvent; 
    FDelphiControl.OnDblClick := DblClickEvent; 
    end; 
    procedure TPieX.EventSinkChanged(const EventSink: lUnknown); 
    begin 
    FEvents := EventSink as IPieXEvents; 
    end; 
    procedure TPieX.DefinePropertyPages( 
    DefinePropertyPage: TDefinePropertyPage) ; 
    begin 
    ( Define property pages here.  Propery pages are defined by calling 
    DefinePropertyPage with the class id of the page.  For example, 
    DefinePropertyPage(Class_PieXPage); ) 
    DefinePropertyPage( Class_PieGeneralPropertyPage ); 
    DefinePropertyPage( Class_PieColorPropertyPage ); 
    end; 
    function TPieX.Get_EndAngle: Integer; safecall; 
    begin 
    Result := FDelphiControl.Angles.EndAngle; ; 
    end; 
    procedure TPieX.Set_EndAngle(Value: Integer); safecall; 
    begin 
    FDelphiControl.Angles.EndAngle := Value; 
    end; 
    function TPieX.Get BrushColor: Integer; safecall; 
    begin 
    Result := FDelphiControl.Brush.Color; 
    end; 
    procedure TPieX.Set_BrushColor(Value: Integer); safecall; 


     21.    ActiveX                           507 


    begin 
    FDelphiControl.Brush.Color := Values
    end; 
    function TPieX.Get_PenColor: Integer; safecall; 
    begin 
    Result := FDelphiControl.Pen.Colors
    end; 
    procedure TPieX.Set PenColor(Value: Integer); safecall; 
    begin 
    FDeiphiControl.Pen.Color := Values
    end; 
    function TPieX.Get_Cursor: Smallint; 
    begin 
    Reault := Smallint(FDelphiControl.Cursor); 
    end; 
    function TPieX.Get_Enabled: WordBool; 
    begin 
    Result := FDelphiControl.Enabled; 
    end; 
    function TPieX.Get_Visible: WordBool; 
    begin 
    Result := FDelphiControl.Visible; 
    end; 
    procedure TPieX.Paints
    begin 
    FDelphiControl.Paint ; 
    ends
    procedure TPieX.Set_Cursor(Value: Smallint); 
    begin 
    FDelphiControl.Cursor := TCursor(Value) ; 
    ends
    procedure TPieX.Set_Enabled(Value: WordBool); 
    begin 
    FDelphiControl.Enabled := Valuesend; 
    procedure TPieX.Set_Visible(Value: WordBool); 
    begin 
    FDelphiControl.Visible := Values
    ends
    procedure TPieX.ClickEvent(Sender: TObject) ; 
    begin 
    if FEvents  nil then FEvents-OnClick; 
    ends
    procedure TPieX.DblClickEvent(Sender: TObject); 
    begin 
    if FEvents <> nil then FEvents.OnDblClick; 
    ends
    function TPieX.Get_StartAngle: Integers
    begin 
    Result := FDelphiControl.Angles.StartAngle; 
    ends
    procedure TPieX.Set_StartAngle(Value: Integer); 


    508                                            V.   OLE 


    begin 
    FDelphiControl.Angles.StartAngle := Value; 
    end; 
    initialization 
    TActiveXControlFactory.Create( 
    ComServer, 
    |         TPieX, 
    TPie, 
    Class_PieX, 
    1, 
    '{6DB6FBDO-96D3-11DO-AOCO-OOC04FC29155}', 
    0); 
    end. 

          .  
InitializeControl      VCL,  
  ActiveX,        
   . 

    procedure TPieX.InitializeControl; 
    begin 
    FDelphiControl := Control as TPie; 
    FDelphiControl.OnClick := ClickEvent; 
    FDelphiControl.OnDblClick := DblClickEvent; 
    end; 

    .        
     ActiveX. 
      .        
  (Event Sink)   
EventSinkChang?cr~Hnace"ffo1<a3aH~npHMep  . 

    procedure TPieX.EventSinkChanged(const EventSink: lUnknown); 
    begin 
    FEvents := EventSink as IPieXEvents; 
    end; 

       Pielmpl.pas    ,   
  DAX TActiveXControlFactory.      
  ActiveX       Delphi 
ComServer.     ComServer   
 CLSID    ,    ,   
      .   
  . 

    initialization 
    TActiveXControlFactory.Create( 
    ComServer, 
    TPieX, 
    TPie, 
    Class_PieX, 
    1, 
    '{6DB6FBDO-96D3-11DO-AOCO-OOC04FC29155)', 
    0); 
    end. 

      GU1D,    
 TActiveXControlFactory. Create,     
 .       ,  
         < >. 
lie,  ,      
ActiveX     .    
ActiveX  ,       Angle  
Color    ActiveX. 

       

         ,   
      ActiveX   
     .   
    DefinePropertyPage    
.    

     21.    ActiveX                           509 


        .     
  DefinePropertyPages,     
 ActiveX.      ,  
   DefinePropertyPage,   . 

    property!TPieX.DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage); 
    begin 
    DefinePropertyPage( Class_PieGeneralPropertyPage ); 
    DefineP|ropertyPage ( Class_PieColorPropertyPage ) ; 
    end; 
    Class_DC<j)lorPropPage 
    Class_DFontPropPage 
    Class_DplcturePropPage 
    Class_DStringPropPage 

           File'=?New   
 ActiveX     Property Page.  
        
T'TEXCONTROL. DPR " \UDELPHI3\CHP21\.     
    PieAngle  PieColor.      
   .     
       ActiveX     
  .      
 tJpaatePropertyPage  UpdateObject. 

    procedure  PieGeneralProperty Page.UpdatePropertyPage; 
    begin 
    {   __   OleObject.} 
    StartAngleTrackBar. Pos.iTlon~"':= OleObject. Start'Angle; 
    EndAngleTrackBar.Position := OleObject.EndAngle; 
    end; 
    procedure TPieGeneralPropertyPage.UpdateObject; 
    begin 
    (    01^1;_,.,.,^^. } 
    OleObject.StartAngle :"= StartAngleTrackBar.Position; 
    OleObject.EndAngle := EndAngleTrackBar.Position; 
    end; 


         ActiveX 

        ActiveX    
-   .     
ActiveX  DllRegisterServer.   ,     
Windows    ActiveX,      
        
Delphi.       
(TActiveXControlFactory),        
 . 
     "  ActiveX^   
Run^Register ActiveX Server.     ActiveX  
,     Delphi.     
Component'=>lnstall ActiveX control,       
Import ActiveX Control (. 21.10). 
            
PieXControlLib,      New      
PieXControl.dll.     OK Delphi   
 DllRegisterServer,       
  .       
   Add to package.    :   
-^   ActiveX       
 .         
PieLib.dpk,      ,     . 

    . 21.10.   Import ActiveX Control 


    510  V.   OLE 

           ActiveX   
 Delphi    PieX.     , 
     ActiveX    
Delphi 3.  ^. . _   
ActiveX  ,        
  . 

      ActiveForm 

     ActiveForm        
    ActiveX.  ,  
  ActiveX      
  ActiveX.  ,    
,   ,      ActiveForm. 
       ,    ActiveForm 
   BDE     , ,   , 
         
 Borland (Data Broker),     
       ,   Internet. 
         ActiveForm ,    - 
 .    _ Delphi  
,      ,   , 
"^    ActiveX.  ,   
,     VCL,   ,   
 ;      
  ActiveForm. 
      "      
 VCL,      ActiveForm    
,       ActiveX.   
 ,   Get  Set     
  ,      VCL. 
       ActiveForm      
   ActiveX,       
 . 
    1.  ActiveForm      File'=i>New  
    11\/?;"   
ActiveX.  ActiveForm  ""   TActiveForm, 
,        
"',   ,  ,    
  ..     OK Delphi   
,        ,   
  TActiveForm.  , Delphi     
.        (,   
..),     ,    . 
    2.    ActiveForm      
 . 
    3.         ,   
.       (View^Type Library)  
  .     Refresh,  
     .   Delphi  
       . 
    4.      Get  Set,    
         
.      . 
    5.    4 ActiveForm , 
,       ,   
  ActiveDForm       
,     .  " 7 
    ^^. Delphi  
.       , 
,     Delphi. 
    6.      . 
    7.          
,     ActiveX. 
       ActiveForm      
  ActiveX,       
.         
  ActiveForm,     TDBChart, TTable  
 TCheckBox.  TDBChart    Country,   
     .  TCheckBox   
     . 

     21.    ActiveX                           511 

           ActiveForm  
    .  ActiveFormXControl  
  \UDELPHI3\CHP21\ACTIVECHARTFORM    
.    Delphi,      
  Run^Register ActiveX Server. 

       ActiveX   ActiveForm  Web 

       ActiveX  4' ActiveForm  
   Web.      , 
    Web,   .   
   . 
    1.   Project^Web Deployment Options. 
    2.   Target Dir     Web,    
   ActiveX   ActiveForm (   
).        UNC,  
\\SERVERMACHINE\OCX_FILES\  S: \OCX_FILES\. 
    3.   Target URL  ,      
,       ActiveX   
ActiveForm.      URL,   
  Web,  http: //ServerMachine/.      
   . 
    4.   HTML Dir   ,   Delphi  
 HTML-      ActiveX.   
        UNC. 
       ,     Target Dir,   
      HTML-,    
.      Web-,     
      URL,  file:///c:\TestRoot\. 
    5.    . 
    6.   Project"^ Build All.    ActiveX 
(   ),     ActiveX  
 ActiveForm. 
    7.   Project^Web Deploy.   ActiveX 
    Target Dir,    . 2.   HTML 
Dir,   . 4,   HTML-,     
   ActiveX.  HTML- .   
    ,      . 3. 
    8.   Web    HTML-. 
         ,  ActiveForm 
         . 
         . 

       

             
 (runtime packages).    ActiveX   
ActiveForm  ,     Deploy Required Packages. 

      CAB 

         Use CAB file 
compression,      ActiveX   
ActiveForm    ,    DPL   
.        
Internet Explorer 3.01.     Netscape Navigator  
 -.    ActiveX,  (  
)       -.   
     -,     .  
    CAB,      , 
     . 

    512                                            V.   OLE 


       

           ActiveX   
ActiveForm,     Code sign project,     
 Code Signing   Web Deployment Options   . 

    Have obtained a Software Publishing Certification file (.SPC) Private Key (.PVK) 

       ?  ,   Microsoft Internet 
Explorer,   Authenticode.    Internet 
Explorer       
       
     ,    
 Internet,   ActiveX   ActiveForm.   
    (Digital ID)   VeriSign 
(www.verisign.com)   "     
 Software Publishing Certificate    Private Key, 
       . 
         
       Internet. 
     ,     
,  ,        
    Internet.     
   VeriSign Software Publisher Digital  
  Web-  VeriSign   http://www.verisign.com. 

    ! , ,     
   .  ,    
  Digital ID,   Digital ID  
           
Internet Explorer.   Authenticode     
  ,        Digital 
ID.     Internet Explorer,    
 . 


     

       ,   Delphi 3   
   ActiveX    VCL 
(  TWinControl)      ActiveX  
  TGraphicControl. 
       (  PieX)     
 ,      , 
        . 
     ,       ActiveForm,  
        
      ActiveX.  ,  
       ActiveX  
 Web (        
Internet Explorer). 
       ,    ,   
      Delphi 3  
   ActiveX.  ,    
 ActiveX      , 
  Delphi. 

     21.    ActiveX                           513 
    17  Delphi 3.   
