how()
frm.Show
''''** show form and redraw
frm.Refresh
End Sub
Public Sub Hide()
frm.Hide
''''** erase form but leave form object in memory
End Sub
That''''s it, the class CProgress is now completely implemented!
Classes vs. Instances
Before we begin our discussion of COM, let''''s review the notion of classes, and instances of classes. Consider the following client code:
Dim p1 As CProgress, p2 As CProgress, p3 As CProgress
Set p1 = New CProgress
Set p2 = New CProgress
Set p3 = New CProgress
p1.Value = 40
p2.Value = 5
p3.Value = 99
p1.Show
p2.Show
p2.Hide
Stop
''''** pause client and activate the debugger
How many instances of CProgress exist in memory? Three! How many progress indicator forms exist in memory (i.e. instances of frmProgress)? Three! How many of these form instances are visible on the screen? One! Okay, now you''''re ready to start the first lesson on.