home *** CD-ROM | disk | FTP | other *** search
- VERSION 2.00
- Begin Form dlgInsert
- BorderStyle = 3 'Fixed Double
- Caption = "Insert Object"
- Height = 2775
- Left = 3120
- LinkMode = 1 'Source
- LinkTopic = "Form2"
- MaxButton = 0 'False
- MinButton = 0 'False
- ScaleHeight = 2370
- ScaleWidth = 4260
- Top = 1800
- Width = 4380
- Begin ListBox lstObjects
- Height = 1395
- Left = 120
- TabIndex = 3
- Top = 720
- Width = 2535
- End
- Begin CommandButton cmdOK
- Caption = "OK"
- Default = -1 'True
- Height = 495
- Left = 2880
- TabIndex = 1
- Top = 720
- Width = 1215
- End
- Begin CommandButton cmdCancel
- Cancel = -1 'True
- Caption = "Cancel"
- Height = 495
- Left = 2880
- TabIndex = 2
- Top = 1320
- Width = 1215
- End
- Begin Label Label1
- Caption = "Object Type:"
- Height = 255
- Left = 120
- TabIndex = 0
- Top = 360
- Width = 1335
- End
- Sub cmdCancel_Click ()
- Unload dlgInsert
- CancelFlag = True
- End Sub
- Sub cmdOK_Click ()
- On Error Resume Next
- ' determine class name
- ' since class names without associated protocols aren't included the lstObjects
- ' list box, the FindClass function is used to match the server name displayed in
- ' the list box with the appropriate Class name
- ClassDisplay = lstObjects.List(lstObjects.ListIndex)
- frmMain.OleClient1.Class = FindClassName(ClassDisplay)
- ' object is embedded
- frmMain.OleClient1.ServerType = OLE_EMBEDDED
- ' set cursor to hourglass
- Screen.MousePointer = 11
- Unload dlgInsert
- End Sub
- Function FindClassName (ByVal S$) As String
- ' This function searches the ServerClassDisplay items in the registration
- ' database until it locates the string that was selected in the lstObjects
- ' list box. The function returns the Class name associated with the
- ' selected ClassDisplay name. You do not need this routine if you
- ' simply display the Class names in the lstObects list box, however,
- ' Class names are not always recognizable by the user.
- Dim I As Integer
- Dim Count As Integer
- Count = frmMain.OleClient1.ServerClassCount - 1
- For I = 0 To Count
- If (frmMain.OleClient1.ServerClassesDisplay(I) = S$) Then
- Exit For
- End If
- Next I
- 'set global index variable for future reg database queries
- RegIndex = I
- FindClassName = frmMain.OleClient1.ServerClasses(RegIndex)
- End Function
- Sub Form_Load ()
- Dim I As Integer
- Dim Count As Integer
- Screen.MousePointer = 11
- Count = frmMain.OleClient1.ServerClassCount - 1
- 'display available server apps in list box
- For I = 0 To Count
- 'check to make sure the server class supports at least one protocol
- 'before adding it to the list box
- frmMain.OleClient1.ServerClass = frmMain.OleClient1.ServerClasses(I)
- If (frmMain.OleClient1.ServerProtocolCount) Then
- lstObjects.AddItem frmMain.OleClient1.ServerClassesDisplay(I)
- 'lstObjects.List(I) = frmMain.OleClient1.ServerClassesDisplay(I)
- End If
- Next I
- lstObjects.ListIndex = 0
- Screen.MousePointer = 0
- End Sub
- Sub lstObjects_DblClick ()
- Call cmdOK_Click
- End Sub
-