home *** CD-ROM | disk | FTP | other *** search
- VERSION 5.00
- Begin VB.Form Form1
- Caption = "Object Sharing Client"
- ClientHeight = 1815
- ClientLeft = 60
- ClientTop = 345
- ClientWidth = 6255
- LinkTopic = "Form1"
- LockControls = -1 'True
- ScaleHeight = 1815
- ScaleWidth = 6255
- StartUpPosition = 3 'Windows Default
- Begin VB.CommandButton cmdClose
- Caption = "&Close"
- Height = 375
- Left = 4680
- TabIndex = 8
- Top = 1200
- Width = 1455
- End
- Begin VB.CommandButton cmdDisplay
- Caption = "&Display Text"
- Height = 375
- Left = 4680
- TabIndex = 7
- Top = 720
- Width = 1455
- End
- Begin VB.CommandButton cmdSetText
- Caption = "&Set New Text"
- Height = 375
- Left = 4680
- TabIndex = 6
- Top = 240
- Width = 1455
- End
- Begin VB.TextBox txtLCase
- Height = 375
- Left = 1680
- TabIndex = 5
- Top = 1200
- Width = 2415
- End
- Begin VB.TextBox txtUCase
- Height = 375
- Left = 1680
- TabIndex = 3
- Top = 720
- Width = 2415
- End
- Begin VB.TextBox txtText
- Height = 375
- Left = 1680
- TabIndex = 1
- Top = 240
- Width = 2415
- End
- Begin VB.Label Label2
- Caption = "Lower Case:"
- Height = 255
- Index = 2
- Left = 180
- TabIndex = 4
- Top = 1260
- Width = 1335
- End
- Begin VB.Label Label2
- Caption = "Upper Case:"
- Height = 255
- Index = 1
- Left = 180
- TabIndex = 2
- Top = 780
- Width = 1335
- End
- Begin VB.Label Label2
- Caption = "&Text:"
- Height = 255
- Index = 0
- Left = 180
- TabIndex = 0
- Top = 300
- Width = 1335
- End
- Attribute VB_Name = "Form1"
- Attribute VB_GlobalNameSpace = False
- Attribute VB_Creatable = False
- Attribute VB_PredeclaredId = True
- Attribute VB_Exposed = False
- Option Explicit
- Dim objsvr As IServer.ObjServer
- Dim WithEvents so As IServer.SomeObject
- Attribute so.VB_VarHelpID = -1
- Dim sc As IServer.IStringCase
- Private Sub cmdDisplay_Click()
- ' Have the component display a message box containing the
- ' stored text.
- so.Display
- End Sub
- Private Sub cmdSetText_Click()
- ' Set the text and get the uppercase through the default inteface.
- so.Text = txtText
- txtUCase = so.IStringCase_UCaseText
- ' Get the lowercase text through the IStringCase interface.
- txtLCase = sc.LCaseText
- End Sub
- Private Sub cmdClose_Click()
- Unload Me
- End Sub
- Private Sub Form_Load()
- ' Create the object server
- Set objsvr = New IServer.ObjServer
- ' Get the shared object
- Set so = objsvr.SomeObject
- ' Get pointer to the shared object's IStringCase interface
- Set sc = so
- End Sub
- Private Sub so_TextChanged(str As String)
- ' Get the normal and uppercase text through the default
- ' interface.
- txtText = so.Text
- txtUCase = so.IStringCase_UCaseText
- ' Get the lowercase text through the IStringCase interface.
- txtLCase = sc.LCaseText
- End Sub
-