Dear all,
I am having a problem writing a few objects in VB. I have created an "interface" class containing a few public routines. I am trying to achieve polymorphism in VB so that each of my classes that "inherit" (using the Inherits statement) some standard functionality from the base class. This explains it better:
Class ITable (My Interface)
- Public Property TableName
- Public Property IDField
- Public Sub Delete
- Public Sub Populate
Class Address (Inherits ITable)
- Public Function Add(val1, val2...)
- Private Sub ITable_Delete()
- Private Sub ITable_Populate()
- Private Property ITable_TableName
- Private Property ITable_IDField
Class Telephone (Inherits ITable)
- Public Function Add(val1, val2...)
- Private Sub ITable_Delete()
- Private Sub ITable_Populate()
- Private Property ITable_TableName
- Private Property ITable_IDField
etc etc etc...
BTW: Add is implemented separately and not as part of the interface as its parameters change each time - but this is simply the specialisation of each class. The Delete and Populate methods have basically the same functionality in each.
My Problem: BASICALLY at design-time I cannot access the properties or methods that are inherited from the ITable base class. EG:
Dim objTest as ITable
Set objTest = New Address
objTest.Add(val1, val2...) ' <- NO PROBLEM
objTest.Populate ' <- PROBLEM! It says method does not exist
objTest.TableName ' <- SAME PROBLEM!!
What am I doing wrong!???
TIA,
Jason
I am having a problem writing a few objects in VB. I have created an "interface" class containing a few public routines. I am trying to achieve polymorphism in VB so that each of my classes that "inherit" (using the Inherits statement) some standard functionality from the base class. This explains it better:
Class ITable (My Interface)
- Public Property TableName
- Public Property IDField
- Public Sub Delete
- Public Sub Populate
Class Address (Inherits ITable)
- Public Function Add(val1, val2...)
- Private Sub ITable_Delete()
- Private Sub ITable_Populate()
- Private Property ITable_TableName
- Private Property ITable_IDField
Class Telephone (Inherits ITable)
- Public Function Add(val1, val2...)
- Private Sub ITable_Delete()
- Private Sub ITable_Populate()
- Private Property ITable_TableName
- Private Property ITable_IDField
etc etc etc...
BTW: Add is implemented separately and not as part of the interface as its parameters change each time - but this is simply the specialisation of each class. The Delete and Populate methods have basically the same functionality in each.
My Problem: BASICALLY at design-time I cannot access the properties or methods that are inherited from the ITable base class. EG:
Dim objTest as ITable
Set objTest = New Address
objTest.Add(val1, val2...) ' <- NO PROBLEM
objTest.Populate ' <- PROBLEM! It says method does not exist
objTest.TableName ' <- SAME PROBLEM!!
What am I doing wrong!???
TIA,
Jason