|
-
Jun 1st, 2001, 08:00 AM
#1
Using Implements Keyword
Hello Everybody,
I have been developing components and always been using them through the CreateObject Method.
I know that there are other methods to use components as well and I am sure most of you might be aware of the Implements Keyword.
Well I wish to use that method for exposing a particular private function of a class.
Firstly do you know whether the Implements can be used in anything other than a class?
Secondly what is the exact syntax of using the implements keyword. I keep on getting it wrong.
Here is my problem in a bit more detail :-
My vbproject is registered as Something and the class is called SomeClass.
If I wish to expose the "Private Function CompareData Method" of this class, using the Implements Keyword how should I go about it.
Public Function calculateLCM(ByVal iInputOne As Long, _
iInputTwo As Long) As Double
calculateLCM = dLcmProduct
End Function
Private Function CompareData(ByVal collFactorsOne As Collection, _
ByVal collFactorsTwo As Collection _
) As Double
Dim xdResult As Double
CompareData = xdResult
End Function
I wish to expose the CompareData Method in my program exe. Since it is a private function, I know that it cannot be done by creating an instance of the object.
Regards,
Abhijit Shrikhande
-
Jun 3rd, 2001, 04:51 PM
#2
Fanatic Member
From MSDN:
When a Visual Basic class implements an interface, the Visual Basic class provides its own versions of all the Public procedures specified in the type library of the Interface.
Therefore, you can not expose the private procedures. Also when using Implements keyword, your super class should only contain the interface, all the implementation will be done in the sub-class.
Regards,
TheBao
-
Jun 5th, 2001, 08:25 AM
#3
Junior Member
Implements
As VB does not have inheritance, you will have a problem here.
Implements will only provide a 'FrameWork' if you like for the method.
No code in the method.
To imitate is human... to copy without recognition is theft.
-
Jun 6th, 2001, 03:03 AM
#4
THANKS
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
|