    244	 ActiveX 

     10.     ActiveX 

          ActiveX 
(   - OLE).  ActiveX   
  ActiveX,        
  ActiveX, , ,  Microsoft Internet Explorer. 
     ActiveX      ( 
  ).   ActiveX   , 
        
 Internet     . 

    10.1.  ActiveX 

     ActiveX     ,  
 ActiveX.   ActiveX     
  /      . 
      ActiveX    
Microsc1':.    Binder (),   
Microsoft Office  Windows 95.     
    Office    , 
   Office   . 
         ActiveX    ActiveX 
- ,    
- ( , 

    10.1.1.   ActiveX 

      OLE,     ActiveX, 
    -. - 
    ActiveX. 
        ActiveX     
 .  ActiveX    
  -   ,   
      -. 
    ,    Microsoft Excel    
Internet Explorer   -. 

    :    ActiveX     
ActiveX. !-" ActiveX ,     . 

      ActiveX    . ,  
 Microsoft Word      
-.    Word  Internet Explorer Word 
  ,     .  
  .bmp  Word     Paint. 
          . ,  
 "Internet Explorer  Office Binder". 


     10.     ActiveX 245 


    . 10.1.  .doc,   Internet Explorer.  
  (Microsoft Word)    . 


    10.1.2.  ActiveX    

     ActiveX     
    - OLE.  
        
     .  
      ActiveX  
     -. 
            Word, 
   ,   Microsoft Excel,   
ActiveX,   Word,    Internet Explorer.    
 ActiveX      , 
,    .    Word 
  .   ,   ActiveX 
  ,    
        
-.    Word   -, 
  ActiveX - (Internet Explorer) (. 10.2). 

    10.1.3.   ActiveX 

     ActiveX        
,    . 


    246  ActiveX 


     - Microsoft Word 
    Microsoft Excel -	Microsoft Word --    - 
      Microsoft Excel 
        ,     
     - Internet Explorer 
     ActiveX -   Excel 
      Microsoft Word 
    -      
         - 

    . 10.2.       ActiveX. 

     ActiveX    -  
           
  .  ,     ,  
     .       
,       ,  
     . 
      -   ActiveX 
     Web, ,  Internet Explorer  
NetScape Navigator. 
     ActiveX     .  
 ,    ,  
,     . 
    Web        ActiveX. 
  ActiveX  Web,      
     . 
         ActiveX  
      . 
    ActiveX,     
 , ,  Microsoft Visual Basic 5.0, Microsoft 
Visual Java++  Microsoft Visual C++. ,  Visual Basic   
 ActiveX,         HTML. 

    10.1.4. Internet Explorer  Office Binder 

        Internet Explorer  3.0  4.0 
 Microsoft Office Binder,       
 ActiveX. Internet Explorer 3.0 
     Microsoft Internet Explorer  3.0    ActiveX 
 ,       -, 
     Internet. 
    ,       
 ,  Internet Explorer,   ,    
      Visual Basic.      
   ,    URL (Uniform Resource Locator 
  )   Address     . 


     10.     ActiveX 247 

         ActiveX,     
Visual Basic,     Internet Explorer 3.0. 

    . 10.3.  ActiveX,   Internet Explorer. 

    Microsoft Office Binder 

    Microsoft Office Binder    .   
         
  . 
         ActiveX,   
 Office Binder. , Binder     
,    Word,     
Excel,     .     
 ,        
,      . 
   Binder       
    . 

    Microsoft Internet Explorer 4.0 

     4.0  Internet Explorer   Windows 95 
Explorer ()   Internet Explorer 3.0   , 
  Windows Explorer.  ,   
  Internet,     
     Internet.     
     Windows Explorer     Internet. 


    248  ActiveX 


    Windows Explorer,   Internet Explorer,   
  ActiveX.     , 
    ActiveX,   Windows Explorer. 
    ,      HTML (, 
 Internet Explorer)  Windows Explorer. Web-,   HTML, 
       ,   Word  
  Microsoft Excel. 

    10.1.5.  ActiveX  Visual Basic 

     Visual Basic  ActiveX    UserDocument 
  ,  Visual Basic   ActiveX.  
UserDocument     ActiveX. 

     UserDocument 

     UserDocument      
UserControl,     .    UserControl, 
 UserDocumeni   ,     
    .  UserDocument  
 , ;      . 
       UserControl .   "  
 "  9 "   ActiveX". 
  ~  .   "   
"  7 "  ActiveX". 

    ji!.*:^:. 
    Project- Project"! 
     @ ;iQ 
    ^ Ptojettl (Books.vbp) 
    El- C3 Forms 
    ;     '-& rrrnBooks (frmBooks.frm)  S3 User Documents 
    , f ,;>        

    . 10.4.    ActiveX  
 Project Explorer. 

      . 10.4    ,  
    ActiveX    UserDocument.  
     ,   
  . 

      ActiveX 

             
  . 
         ActiveX    . 
        
ActiveX, ,       UserDocument. 


          10.     ActiveX 249 


    . 10.5.     . 

    10.2.     ActiveX 

       ActiveX   ActiveX.   
  ActiveX Visual Basic   ;  
 ActiveX      Standard EXE. 
          ActiveX    
    -. ,    
ActiveX      .    
       ,    
  ActiveX  . 

    10.2.1.    ActiveX 

     ActiveX     .  .dll .    
 ActiveX   ActiveX       
   UserDocument.         
 UserDocument   ,    
 ,        . 
       ActiveX    .  .dll,   
  Visual Basic (.vbd).    ActiveX   
,   Internet Explorer,     
   .vbd. 
             : 
     .dob Visual Basic      
   .dob.        
  UserDocument   . 
     .dox    Visual Basic     
 .dox.  ,   ,   
    UserDocument. 


    250     ActiveX 


     .dob  .dox      ActiveX,  
,   .      .frm  .frx 
 Standard EXE . 

    10.2.2.    ActiveX 

       ActiveX  Visual Basic     
 ActiveX     Standard EXE. 

        ActiveX 

        ActiveX Visual Basic   
ActiveX Document DLL  ActiveX Document EXE. 

    New Project 

     ActiveX 


    . 10.6.     ActiveX. 

       Standard EXE 
        Standard EXE    
ActiveX    ActiveX Document Migration Wizard.  
         ActiveX  
    ActiveX EXE  ActiveX DLL. 
     ActiveX Document Migration Wizard     
  ,   Standard EXE,    
ActiveX,       . 
          ActiveX: 
    1.   Add-lns   ActiveX Document Migration Wizard 
( Add-In Manager)    . 
    2.   Form Selection   ,   
,   Next. 


     10.     ActiveX	251 

    3.   Options   : a)  Comment out invalid code. 
6) Remove original forms after conversion. 
    ) Convert to an ActiveX EXE (    Standard EXE,  
  ). 
    4.   Finished   No ,   
   ,    Save current settings 
as default (    )   Finish. 

    10.2.3.    ActiveX 

       ActiveX   in-process (.dll)  
out-of-process (.exe)     .  
      ActiveX , 
   . 
         Visual Basic    
(.vbd).  .vbd     OLE.  ,  
           
OLE.    .   " "  
7 "  ActiveX".    ActiveX, ,  
 Internet Explorer,      .vbd. 
     ,     ActiveX   
 : . ( .dll)  .vbd. 

    10.2.4.   ActiveX   

          ActiveX,   
  .   ActiveX   () 
        ActiveX. 
   ActiveX    . 
        ,     
  ActiveX   .     
 ,    . 
      ,       
   ,     
 .      Parent 
 ActiveX,     . 
        ,   ActiveX  
     Visual Basic Hyperlink.   
  Hyperlink  ActiveX     
      URL. 

    10.2.5.    

        UserDocument ,  ,  
,    ,    , :  
 ,         
  .     ,  
        Internet Explorer. 
      ,      
  ActiveX: 


    252     ActiveX 


    	 

    Initialize	 Initialize      
   ActiveX.     ,  
      ActiveX. 
    InitProperties	 InitProperties ,   ActiveX 
    ,        
.      InitProperties  
 ReadProperties. 
    ReadProperties	 ReadProperties      
  PropertyBag. 
    Terminate	 Terminate     
 ActiveX.  Internet Explorer 3.0     : 
ActiveX.         
,    ActiveX   .   
Terminate,      ,    Nothing. 
    Show	 Show      :   
   ActiveX,     . 
     Internet Explorer  Back  Forward, 
    ActiveX   History. 
    Hide	 Hide      :   
   ,    Terminate.  
 Internet Explorer ,        
       . 
       Show  Hide    
.       .   . 

    10.2.6.     

        ,     
  ActiveX,       
 . , ,   , 
      ,   
    ActiveX,    . 
          : 
       Internet Explorer    ,     
Microsoft Office Binder  ; 
        Office Binder         
 ActiveX   .      
 InitProperties   ReadProperties; 
        Internet Explorer  Show  Hide ,    
 . 

    10.2.7.     

        ActiveX   TypeName  
 Parent  UserDocument,     : 

    Dim  strContainer  As   String strContainer  =  TypeName(UserDocument.Parent) 


     10.     ActiveX	253 


     Internet Explorer  ,   Parent,  IWebBrowserApp. 
     Show ,   ActiveX    , 
         
.   ,    
.    ,    
Parent  UserDocument   IWebBrowserApp,   
 : 

    Private   Sub  UserDocument_Show() Dim  strContainer  As   String 
    strContainer  =  TypeName(UserDocument.Parent) If   strContainer  =   
"IWebBrowserApp"   Then 
    MsgBox   ":     "   &  _ 
    "         Internet  Explorer   "   &  _ 
    "3.0    " Else 
    MsgBox   "  ,            "   &  _ 
    "   Internet  Explorer   3.0    " End  If End  Sub 


    :    ,    Visual Basic 5.0, 
 ActiveX       , 
   .    
 .   "   "  7 "  
  ActiveX".      .  
 " "  8 "   ActiveX". 


    10.3.     ActiveX 

        ActiveX     
     .  
   ,       
     ActiveX.         
 ,    .   
 ,       
,        
 ActiveX.   ,      
 ,    Internet Explorer,     
   Visual Basic. 

    10.3.1.    Visual Basic 

       ActiveX   .  
  ActiveX  ,  ,   
   ,      
  .   ,       
,    . 
     ,  ,     
   ,      
,       ,   
ActiveX     . 

    10.3.2.   ActiveX   

       ActiveX  -   
    .vbd.   ActiveX 
  Visual Basic . 


    254	  

       ActiveX  : 
    1.      .vbd  -. 
    2.   Visual Basic   . 
          ,     
    .vbd. 
    3.   My Computer  Windows Explorer    .vbd. 
    .vbd  -. 
    4. ,   .vbd   - 
,  ,   Visual Basic    . 

    10.3.3.     

     ,      ,  
      Sub Main    
  . 
        StartMode     
,      .   , 
    : 

    If  .StartMode  =  vbModeStandalone   Then 
    frmContainer.Show End   If 

           .  
     ,    
      .  
    , ,   WebBrowser. 
         : 
    1.        Sub MainQ. 
    2.   Project  Project Properties. 
    3.   General   Startup Object  Sub Main. 
    4.   Component    Start Mode  
Standalone   . 
    5.    . 

    10.4.   

       ActiveX      
 .     ActiveX    
  ,     
   .     
,       . , 
  ,   ActiveX   
 . 

    10.4.1.      

       ActiveX  ,   
   ,    
. ,  ,     Internet 
Explorer, ,       
 HTML. 


     10.     ActiveX	255 


     ActiveX,   Microsoft Office Binder,    
  ,  ,    Internet Explorer. 
       Binder  
  . 

    :    UserDocument     
 Add User-Document   Project.     UserDocument 
   User Document. 


         

        ActiveX     
,       , 
    . 
     -  Internet Explorer,     
      NavigateTo  Hyperlink, 
     : 

    Private   Sub   cmdMoveTo_Click() 
    '   ,          UserDoc2 
    UserDocument.Hyperlink.NavigateTo  _ 
    ":\projects\UserDoc2.vbd" End  Sub 


    :      (,  
Microsoft Binder),    ,  
 ,       . 


    10.4.2.    

          ActiveX   ,  
 ,      ActiveX.  
Internet Explorer, ,     ActiveX  
  ,    Favorites ()    
    . 
             ActiveX 
   .    
       . 
         ActiveX    
ActiveX    .    
    ActiveX ,      
   . 
             
  . 


    256   

            . 
 -!,       gDocI  
    Doc1: 

    Public   gDocl   As   String 

         ,   
 ActiveX,    Show  Hide.  
      ,   
 . 

       

     public   ActiveX     
 ActiveX.     ,  
,      ,   
 public,   ActiveX. 
              
gDocl     Is Nothing. 
      ,  public  ActiveX    
     strPropI   Doc1. 
        ,      
 . 

    Private   Sub  UserDocument_Show() If  Not   gDocl   Is   Nothing  Then 
    IblCaption.Caption   =  gDocl.strPropl 
    Set  gDocl   =  Nothing   '      !      '   
    Nothing,           '     
 Else 
    MsgBox   "         UserDocument   Docl" End  if 
End  Sub 

      Hide    

      Internet Explorer  Hide     
 :    ,     
        Terminate. 
     Hide        
    ,    : 

    Private   Sub  UserDocument__Hide () 
    If  Not   gDocl   Is   Nothing  Then Set   gDocl   =  Nothing 
    End  if End  Sub 


    10.4.3.   

          UserControl,    public  
 UserDocument    Property.   
   public        ActiveX. 


     10.     ActiveX	257 


      Public 

       public   ,    
     . 
           strPropI  
 public  ActiveX Doc1.     Text 
  TextBox     : 

    Public   Property  Get   strProplO   As   String 
    strPropI   =  txtDocl.Text End  Property 
    Public   Property  Let   StrPropI(ByVal  _ NewstrPropl  As   String) 
    txtDocl.Text   =  NewstrPropl End  Property 


       Public 

            
  ActiveX  ,       
   public    . 
        ActiveX Doc1    
(Transfer).   Click   Transfer   gDod 
  Me,    Doc1. 
     Doc1      User,    
 . ActiveX  Satellite    
gDod      User  ActiveX Doc1. 

    Private   Sub   cmdTransfer_Click() 
    Set   gDod   =  Me 
    Hyperlink.NavigateTo _ 
    App.Path & "\Satellite.vbd" End Sub 
    Private Sub UserDocument_Show() Dim strUser As String 
    strUser = gDocl.User 
    '    
    End Sub 


      

            . 
     ActiveX  
           . 
     ,   Internet Explorer  Microsoft Office 
Binder,   ,     . 
     ( .vbd    ,   
 )   PropertyBag. 
     PropertyBag      WriteProperties 
 ReadProper-ties    : 
    9 .   136 


    258   
    
    
    	 

    WriteProperty	     PropertyBag. 
    ReadProperty	     PropertyBag. 
        

              
 .   ,   PropertyChanged 
 UserDocument. 
          PropertyChanged   Change 
  TextBox.   ,    
 ,   Internet Explorer,    
   . 

    Private   Sub   txtDocl_Change() 
    PropertyChanged End  Sub 

               
PropertyBag,  ,      , 
   PropertyChanged. 

        .vbd 

        PropertyChanged  ,  
  .     
 WriteProperties. 
     WriteProperty        
.vbd    ,   .   
    : 

    Private   Sub  UserDocument_WriteProperties(PropBag  As  VB.PropertyBag) 
    '            PropertyBag 
    PropBag.WriteProperty   "txtDocl",   _ 
    txtDocl.Text,    "   " End  Sub 
    I 


      

     InitProperties     ,    
  ActiveX,    PropertyBag.  
      ActiveX   
 Read Properties ,   PropertyBag,     
   ReadProperty. 
         ,    : 

    Private   Sub  UserDocument_ReadProperties  _ (PropBag  As  
VB.PropertyBag) '              txtDocl.Text  = 
 ReadProperty("txtDocl", -.  "         ") 

    End  Sub 
    TextBox 


     10.     ActiveX	259 


    10.5.      

       ActiveX      .  
       , 
   . 
           
  ActiveX.      
,       ActiveX, 
   . 

    10.5.1.     

     UserDocument    .    , 
  ,    .   
 ,      . 

      MinHeight  MinWidth 

        ActiveX    , 
   . 
         -,  
       ,  
   ActiveX.    ActiveX  
        
 ,     . 
     ,     ,  
  MinHeight  MinWidth  UserDocument,    
 : 

    Private   Sub  UserDocument_Resize() .  UserDocumentl.MinHeight   =   4000 
    UserDocumentl.MinWidth  =   9000 End  Sub 

      MinHeight  MinWidth  .   
   ,       
  UserDocument,        
    ,    
   .     ,  
MinHeight  MinWidth  . 

    10.5.2.      

       Menu Editor   ActiveX  Visual Basic  
  .      
 About  Help ,      . 
       ActiveX    About.   
         
 ,      . 
     Visual Basic  About     Add Form (. 10.8). 
       About     
   Caption      
Label (. 10.9). 


    260      


    . 10.8.    About    Add Form. 

    . 10.9.   About,      
 Add Form. 


     10.     ActiveX 261 


      Help 

        ActiveX   Help  
   .    
NegotiatePosition,  ,   Help  ActiveX  
   Help . 
         Help    About   
 Menu Editor Visual Basic. 
        Click  About    
 : 

    Private   Sub  mnuAbout_Click() 
    frmAbout.Show  vbModal   '       About        
End  Sub 


    . 10.10.   About       
  -. 

