Attempting to learn polymorphism, etc. in VB6, but my code doesn't do what I want it to
问题 Here's what I've got on a command button; it's just creating variables and attempting to output their ID (which should be an instance variable inherited from the base class.) Private Sub Command1_Click() Dim ball1 As Ball, ball2 As Ball Dim cube1 As Cube, cube2 As Cube Set ball1 = New Ball Set cube1 = New Cube Set cube2 = New Cube Set ball2 = New Ball MsgBoxTheID (ball1) 'errors; should be 0 MsgBoxTheID (ball2) 'errors; should be 3 MsgBoxTheID (cube1) 'errors; should be 1 MsgBoxTheID (cube2)