home *** CD-ROM | disk | FTP | other *** search
/ Visual Basic 4 Power Pack / Visual_Basic4_Power_Pack.bin / vb4files / oledsrvr / client.frm (.txt) next >
Encoding:
Visual Basic Form  |  1996-11-20  |  2.8 KB  |  95 lines

  1. VERSION 4.00
  2. Begin VB.Form frmClient 
  3.    Caption         =   "Get Next Item"
  4.    ClientHeight    =   1320
  5.    ClientLeft      =   585
  6.    ClientTop       =   930
  7.    ClientWidth     =   3300
  8.    Height          =   1725
  9.    Left            =   525
  10.    LinkTopic       =   "Form1"
  11.    ScaleHeight     =   1320
  12.    ScaleWidth      =   3300
  13.    Top             =   585
  14.    Width           =   3420
  15.    Begin VB.TextBox Text1 
  16.       Height          =   855
  17.       Left            =   2010
  18.       MultiLine       =   -1  'True
  19.       TabIndex        =   3
  20.       Top             =   90
  21.       Width           =   1215
  22.    End
  23.    Begin VB.Timer Timer1 
  24.       Interval        =   1000
  25.       Left            =   210
  26.       Top             =   1125
  27.    End
  28.    Begin VB.CommandButton Command1 
  29.       Caption         =   "Request"
  30.       Height          =   450
  31.       Left            =   75
  32.       TabIndex        =   0
  33.       Top             =   75
  34.       Width           =   1830
  35.    End
  36.    Begin VB.Label Label2 
  37.       Alignment       =   1  'Right Justify
  38.       Caption         =   "time"
  39.       ForeColor       =   &H000000FF&
  40.       Height          =   225
  41.       Left            =   1140
  42.       TabIndex        =   2
  43.       Top             =   1080
  44.       Width           =   2100
  45.    End
  46.    Begin VB.Label Label1 
  47.       Caption         =   "Label1"
  48.       Height          =   360
  49.       Left            =   75
  50.       TabIndex        =   1
  51.       Top             =   615
  52.       Width           =   1845
  53.    End
  54. Attribute VB_Name = "frmClient"
  55. Attribute VB_Creatable = False
  56. Attribute VB_Exposed = False
  57. Option Explicit
  58. '-- Technique 'A': will instantiate on Form Load:
  59. Private objDataServer As ServerTest3.CDataServer
  60. '-- Technique 'B': will instantiate on first Request
  61. '   (need to comment out 'Set objDataServer = New ServerTest3.CDataServer'
  62. '    in Form Load event).
  63. 'Private objDataServer As New ServerTest3.CDataServer
  64. Private objRequest As New CRequest
  65. Public mstrProgID As String
  66. Public Function Request() As Boolean
  67. On Error Resume Next
  68. objDataServer.RegisterRequest objRequest
  69. If Err Then
  70.   Label1 = "Error: " & Err.Description
  71.   On Error GoTo 0
  72.   Request = False
  73.   Request = True
  74.   Label1 = "Request in process"
  75. End If
  76. End Function
  77. Private Sub Command1_Click()
  78. Request
  79. Text1.SetFocus
  80. End Sub
  81. Private Sub Form_Load()
  82. '----- comment out next line when using 'Technique B' for
  83. '      instantiating classes - see Declarations section.
  84. Set objDataServer = New ServerTest3.CDataServer
  85. mstrProgID = Format(Now, "hhmmss")
  86. Me.Caption = "OLE Client: " & mstrProgID
  87. End Sub
  88. Private Sub Form_Unload(Cancel As Integer)
  89. Set objDataServer = Nothing
  90. Set objRequest = Nothing
  91. End Sub
  92. Private Sub Timer1_Timer()
  93. Label2 = Time
  94. End Sub
  95.