Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 18
Default Curious - What is Implements used for

Hi,

Just out of curiousity / desire to learn, can someone explain to me what
Implements is useful for?

The way I read the example, variables were defined in one class, then two
classes that Implement that first class have to define all the properties to
cover those variables - does that mean that the only thing implements does
is save you from having to declare the variables in the other 2 classes?
either the example is too simple, or I'm just missing something.

I guess the reason I ask is I was trying to find a way to define a class for
my charts with a "standard" reaction to events (standard for my particular
app), and then for specific charts override some of those events, and I
stumbled across implements, but I'm not sure if that's what I'm looking
for... and now I'm curious.

Thanks,

mike.


  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 415
Default Curious - What is Implements used for

Mike,
The way I use Implements means that you can have a generic variable that is
used for different implentations of the interface.
So, in the example, we know that any varialbe declared as IBarcode will have
the guarateed methods/properties.

'< Class IBarcode
Private Property Get cbarCode_CodeNumber() As String
'Stub signatures only
End Property

Private Property Let cbarCode_CodeNumber(RHS As String)
'Stub signatures only
End Property
'</ Class IBarcode

'< Class cCode2of5
Implements IBarCode
Private Property Get cbarCode_CodeNumber() As String
'Code specific to cCode2of5
End Property

Private Property Let cbarCode_CodeNumber(RHS As String)
'Code specific to cCode2of5
End Property
'</ Class cCode2of5

'< Class cEAN13
Implements IBarCode
Private Property Get cbarCode_CodeNumber() As String
'Code specific to cEAN13
End Property

Private Property Let cbarCode_CodeNumber(RHS As String)
'Code specific to cEAN13
End Property
'< Class cEAN13

' VBA code
Dim MyBarCode as IBarCode

Set MyBarCode = New cEAN13
'and/or
Set MyBarCode = New cCode2of5

This works because Implements is a contract that each class will expose all
the same signatures that exist in the Interface.

NickHK

"Mike" bl...
Hi,

Just out of curiousity / desire to learn, can someone explain to me what
Implements is useful for?

The way I read the example, variables were defined in one class, then two
classes that Implement that first class have to define all the properties
to
cover those variables - does that mean that the only thing implements does
is save you from having to declare the variables in the other 2 classes?
either the example is too simple, or I'm just missing something.

I guess the reason I ask is I was trying to find a way to define a class
for
my charts with a "standard" reaction to events (standard for my particular
app), and then for specific charts override some of those events, and I
stumbled across implements, but I'm not sure if that's what I'm looking
for... and now I'm curious.

Thanks,

mike.




  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 108
Default Curious - What is Implements used for

Roedd <<Mike wedi ysgrifennu:

Hi,

Just out of curiousity / desire to learn, can someone explain to me
what Implements is useful for?

I guess the reason I ask is I was trying to find a way to define a
class for my charts with a "standard" reaction to events


Implements doesn't support events in COM/OLE, only in .NET, so you're out of
luck with this plan, unfortunately.

Rob


Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
implements statement Hemant_india[_2_] Excel Programming 5 July 29th 06 05:15 PM
A curious question davidm Excel Programming 9 January 17th 06 01:39 PM
Just curious famdamly Excel Discussion (Misc queries) 2 December 7th 05 01:33 AM
Just curious RedChequer Excel Discussion (Misc queries) 3 March 10th 05 11:15 PM
Just Curious Mike Fogleman Excel Programming 7 September 30th 04 08:04 AM


All times are GMT +1. The time now is 02:52 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"