home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Unleashed / Visual_Basic_4_Unleashed_SAMS_Publishing_1995.iso / source / chap16 / oleview / form1.frm (.txt) next >
Encoding:
Visual Basic Form  |  1995-07-14  |  5.1 KB  |  174 lines

  1. VERSION 4.00
  2. Begin VB.Form Form1 
  3.    Caption         =   "Form1"
  4.    ClientHeight    =   4935
  5.    ClientLeft      =   2025
  6.    ClientTop       =   1905
  7.    ClientWidth     =   6060
  8.    Height          =   5625
  9.    Left            =   1965
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   4935
  12.    ScaleWidth      =   6060
  13.    Top             =   1275
  14.    WhatsThisButton =   -1  'True
  15.    WhatsThisHelp   =   -1  'True
  16.    Width           =   6180
  17.    Begin VB.ListBox List1 
  18.       Height          =   840
  19.       Index           =   2
  20.       Left            =   4020
  21.       TabIndex        =   4
  22.       Top             =   660
  23.       Width           =   1815
  24.    End
  25.    Begin VB.ListBox List1 
  26.       Height          =   840
  27.       Index           =   1
  28.       Left            =   2100
  29.       TabIndex        =   3
  30.       Top             =   660
  31.       Width           =   1815
  32.    End
  33.    Begin VB.ListBox List1 
  34.       Height          =   840
  35.       Index           =   0
  36.       Left            =   180
  37.       TabIndex        =   2
  38.       Top             =   660
  39.       Width           =   1815
  40.    End
  41.    Begin VB.Label Label1 
  42.       AutoSize        =   -1  'True
  43.       Caption         =   "Object Get Formats"
  44.       Height          =   195
  45.       Index           =   2
  46.       Left            =   4020
  47.       TabIndex        =   8
  48.       Top             =   420
  49.       Width           =   1365
  50.    End
  51.    Begin VB.Label Label1 
  52.       AutoSize        =   -1  'True
  53.       Caption         =   "Object Accept Formats"
  54.       Height          =   195
  55.       Index           =   1
  56.       Left            =   2100
  57.       TabIndex        =   7
  58.       Top             =   420
  59.       Width           =   1620
  60.    End
  61.    Begin VB.Label Label1 
  62.       Caption         =   "Object Verbs"
  63.       Height          =   195
  64.       Index           =   0
  65.       Left            =   180
  66.       TabIndex        =   6
  67.       Top             =   420
  68.       Width           =   1035
  69.    End
  70.    Begin ComctlLib.StatusBar StatusBar1 
  71.       Align           =   2  'Align Bottom
  72.       Height          =   255
  73.       Left            =   0
  74.       Negotiate       =   -1  'True
  75.       TabIndex        =   5
  76.       Top             =   4680
  77.       Width           =   6060
  78.       _Version        =   65536
  79.       _ExtentX        =   10689
  80.       _ExtentY        =   450
  81.       _StockProps     =   68
  82.       AlignSet        =   -1  'True
  83.       SimpleText      =   ""
  84.       _timers         =   2
  85.       NumPanels       =   3
  86.       i1              =   "Form1.frx":0000
  87.       i2              =   "Form1.frx":010C
  88.       i3              =   "Form1.frx":01FB
  89.    End
  90.    Begin ComctlLib.Toolbar Toolbar1 
  91.       Align           =   1  'Align Top
  92.       Height          =   390
  93.       Left            =   0
  94.       Negotiate       =   -1  'True
  95.       TabIndex        =   1
  96.       Top             =   0
  97.       Width           =   6060
  98.       _Version        =   65536
  99.       _ExtentX        =   10689
  100.       _ExtentY        =   688
  101.       _StockProps     =   96
  102.       ImageList       =   ""
  103.       NumButtons      =   2
  104.       i1              =   "Form1.frx":02EA
  105.       i2              =   "Form1.frx":045F
  106.       AlignSet        =   -1  'True
  107.    End
  108.    Begin VB.OLE OLE1 
  109.       Height          =   2895
  110.       Left            =   180
  111.       TabIndex        =   0
  112.       Top             =   1620
  113.       Width           =   5655
  114.    End
  115.    Begin VB.Menu mnuFile 
  116.       Caption         =   "&File"
  117.       NegotiatePosition=   1  'Left
  118.       Begin VB.Menu mnuFileNewObject 
  119.          Caption         =   "&New Object"
  120.       End
  121.       Begin VB.Menu mnuFileSep1 
  122.          Caption         =   "-"
  123.       End
  124.       Begin VB.Menu mnuFileExit 
  125.          Caption         =   "E&xit"
  126.       End
  127.    End
  128. Attribute VB_Name = "Form1"
  129. Attribute VB_Creatable = False
  130. Attribute VB_Exposed = False
  131. Option Explicit
  132. Private Sub mnuFileExit_Click()
  133.     Unload Me
  134. End Sub
  135. Private Sub mnuFileNewObject_Click()
  136.     Dim I   ' Declare counter variable.
  137.     Dim Buffer As String 'for string manipulation
  138.     'Clear the OLE Control if it contains an object
  139.     If OLE1.Class <> "" Then
  140.         OLE1.Close
  141.     End If
  142.     ' Display the Insert Object dialog box.
  143.     On Error GoTo ThisWayOut
  144.     OLE1.InsertObjDlg
  145.     On Error GoTo 0
  146.     ' Update the list of available verbs.
  147.     Buffer = OLE1.Class
  148.     Me.Caption = "This is not " & _
  149.         Left$(Buffer, InStr(Buffer, ".") - 1) & _
  150.         " running."
  151.     OLE1.FetchVerbs ' Fetch verbs.
  152.     ' Clear the list boxes.
  153.     For I = 0 To 2
  154.         List1(I).Clear
  155.     Next
  156.     ' Fill the verbs list box. Because ObjectVerbs(0) is
  157.     ' the default verb and is repeated in the ObjectVerbs()
  158.     ' array, start the count at 1.
  159.     For I = 1 To OLE1.ObjectVerbsCount - 1
  160.         List1(0).AddItem OLE1.ObjectVerbs(I)
  161.     Next I
  162.     'Fill the Accept Formats list box.
  163.     For I = 0 To OLE1.ObjectAcceptFormatsCount - 1
  164.         List1(1).AddItem OLE1.ObjectAcceptFormats(I)
  165.     Next I
  166.     ' Fill the Get Formats list box.
  167.     For I = 0 To OLE1.ObjectGetFormatsCount - 1
  168.         List1(2).AddItem OLE1.ObjectGetFormats(I)
  169.     Next I
  170.     Exit Sub
  171. ThisWayOut:
  172.     OLE1.Class = ""
  173. End Sub
  174.