|
-
Jun 22nd, 2000, 05:34 PM
#1
Thread Starter
New Member
I have two classes called A and B. They both use a sub procedure within them called calculate_V2. Each class calculates V2 differently.
From my form I want to call one of these sub procedures depending on the situation. So I created an interface to link the two classes called class_interface. In class A and B I wrote 'Implements class_interface' at the top.
In the interface class I wrote
Public Sub calculate_V2()
End Sub
In class A and B I wrote
Public Sub class_interface_calculate_V2()
'calculating code
End Sub
Then in the form, I created a class A object, a class B object and class_interface object. I make class_interface equal class A or B depending on the situation. So when I have 'class_interface.calculate_V2' it calls the associated sub procedure.
Example:
Set class_interface = class A
class_interface.calculate_V2
'This calls calculate_V2 from class A
Set class_interface = class B
class_interface.calculate_V2
'This calls calculate_V2 from class B
This all works fine, sorry for blabbing on!
The problem is class A and B both have the property V2
I want to retrieve this property from either class by using the class_interface.
So in class_interface
Public Property Get V2() as Double
End Sub
In Class A and B
Public Property Get class_interface_V2() as Double
class_interface_V2 = mvarV2
End Sub
So now I want to be able to do this:
Set class_interface = class A
variable = class_interface.V2
'Get the V2 property from class A
Set class_interface = class B
variable = class_interface.V2
'Get the V2 property from class B
But when I run the project I get this error:
Object module needs to implement 'class_interface_V2' for 'class_interface'.
But I think I have already done this!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|