M
Marty Lee
Howdy All,
I'm puzzled by the apparent inelegance that arises when
the "implements" keyword is used. Say that we have the
following two classes, the second class implementing the
first class:
Class 1: "MyInterfaceClass"
With: "MyInterfaceMethod"
Class 2: "MyImplementsClass"
Implements "MyInterfaceClass"
(including MyInterfaceMethod)
and extends with: "MyImplementsMethod"
It should be possible, I think, to declare a new instance
of "MyImplementsClass" and be able to reference both
methods. However, if a new object variable is
declared "as MyInterfaceClass" then I can use
the .MyInterfaceMethod but not .MyImplementsMethod. If
instead I declare an object variable "as
MyImplementsClass" then I can use the .MyImplementsMethod
but not the .MyInterfaceMethod.
To work around the issue I've been using the following:
Dim _
myImplements as MyImplementsClass, _
myInterface as MyInterfaceClass
set myImplements = new MyImplementsClass
set myInterface = myImplements
By having two names for a single object I can get to all
methods. But how ugly! Any suggestions on improving the
esthetics? (I'm working in Word 2000 VBA.)
thanks,
Marty
I'm puzzled by the apparent inelegance that arises when
the "implements" keyword is used. Say that we have the
following two classes, the second class implementing the
first class:
Class 1: "MyInterfaceClass"
With: "MyInterfaceMethod"
Class 2: "MyImplementsClass"
Implements "MyInterfaceClass"
(including MyInterfaceMethod)
and extends with: "MyImplementsMethod"
It should be possible, I think, to declare a new instance
of "MyImplementsClass" and be able to reference both
methods. However, if a new object variable is
declared "as MyInterfaceClass" then I can use
the .MyInterfaceMethod but not .MyImplementsMethod. If
instead I declare an object variable "as
MyImplementsClass" then I can use the .MyImplementsMethod
but not the .MyInterfaceMethod.
To work around the issue I've been using the following:
Dim _
myImplements as MyImplementsClass, _
myInterface as MyInterfaceClass
set myImplements = new MyImplementsClass
set myInterface = myImplements
By having two names for a single object I can get to all
methods. But how ugly! Any suggestions on improving the
esthetics? (I'm working in Word 2000 VBA.)
thanks,
Marty