|
-
May 10th, 2001, 01:54 AM
#1
Implement....
Hello.
I have two classes:
ClassA (Include 2 method: M1, M2)
ClassB (Include Implement of ClassA + New Method M3)
In my program I define the class (as written in MSDN) like this:
Dim ObjA as ClassA
Dim ObjB as new ClassB
set ObjA = ObjB
The problem is that ObjA don't recognize the method M3 !!!
What can I do ???
Thanks for any help.
-
May 10th, 2001, 08:47 AM
#2
Re: Implement....
I think this is because ObjA is ClassA type and not ClassB type. Therefore, it only knows M1 and M2 eventhough in the memory M3 does exist. At least this is how it works in C++.
-Cool Bizs
Good Luck,
-Cool Bizs
-
May 10th, 2001, 08:50 AM
#3
Re: Implement....
If you say implement, are you using the implements keyword? If so, youre actually using an interface. In this case, class A may not include any code, just de declaration of the methods. You will have to write your own implementation of M1 and M2 in class b, but they can be refferenced by an object of class A, but only the methods described in class a.
Tom Cannaerts
[email protected]
Programming today is a race between software engineers striving to build bigger and better idot-proof programs, and the universe trying to produce bigger and better idiots. So far, the universe is winning -- Rich Cook
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
|