Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Quick Interface Question


I have an interface that has all abstract methods, except one metho
that I want every implementation of the interface to have.

When I am implementing an interface, do I have to copy the whol
subroutine from the interface to the implementation or is there a wa
to make the implementation call the interface definition of th
subroutine?

Also does anyone have a good resource for interfaces and user define
classes in VBA because I cannot really find any good ones?

Thank

--
reddog906
-----------------------------------------------------------------------
reddog9069's Profile: http://www.excelforum.com/member.php...fo&userid=2445
View this thread: http://www.excelforum.com/showthread.php?threadid=39068

  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Quick Interface Question


Bump for a quick answer hopefully...

--
reddog906
-----------------------------------------------------------------------
reddog9069's Profile: http://www.excelforum.com/member.php...fo&userid=2445
View this thread: http://www.excelforum.com/showthread.php?threadid=39068

  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Quick Interface Question


Does anyone have any good info on interfaces or can someone answer m
quick question

--
reddog906
-----------------------------------------------------------------------
reddog9069's Profile: http://www.excelforum.com/member.php...fo&userid=2445
View this thread: http://www.excelforum.com/showthread.php?threadid=39068

  #4   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Quick Interface Question


Bump for any help from anyone

--
reddog906
-----------------------------------------------------------------------
reddog9069's Profile: http://www.excelforum.com/member.php...fo&userid=2445
View this thread: http://www.excelforum.com/showthread.php?threadid=39068

  #5   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Quick Interface Question



reddog9069 wrote:
I have an interface that has all abstract methods, except one method
that I want every implementation of the interface to have.

When I am implementing an interface, do I have to copy the whole
subroutine from the interface to the implementation or is there a way
to make the implementation call the interface definition of the
subroutine?

Also does anyone have a good resource for interfaces and user defined
classes in VBA because I cannot really find any good ones?

Thanks


--
reddog9069


Hi,
A good reference on the use of classes in VBA is "The VBA Developer's
Handbook"
http://www.amazon.com/exec/obidos/tg...books&n=507846

I have never played around with the Implements keyword so I can't
answer your question. Maybe you could post it to a straight VB
newsgroup. You seem to be asking for something like implementation
inheritence, which is not directly supported in VB6 or VBA. There *is*
a trick involving delegation that supposedly provides a work-around,
but I honestly don't recall how it works. Maybe on a VB group (but not
the VB.Net!)you can find an answer.

Hope that helps

-John Coleman


------------------------------------------------------------------------
reddog9069's Profile: http://www.excelforum.com/member.php...o&userid=24458
View this thread: http://www.excelforum.com/showthread...hreadid=390686




  #6   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 1
Default Quick Interface Question


If it is not directly supported in VBA that is fine. I have no proble
just copying the method into the implementation of the interface, bu
that just seems like a big no no from a programming stand point.
will give that book a look through, next time I am at a book store, o
if it is available at my library I will check it out.

I know on the msdn site they talk about interfaces having both abstrac
and non-abstract components, but they only talk about simple things lik
attributes, or properites and their corresponding get and let methods
but nothing along the lines of complete sub routines or functions.

I know it is so easy in c++ and java, using the virtual keyword, but
cannot figure it out in VBA, so maybe VBA was not designed for thi
complex of a program.

Thank

--
reddog906
-----------------------------------------------------------------------
reddog9069's Profile: http://www.excelforum.com/member.php...fo&userid=2445
View this thread: http://www.excelforum.com/showthread.php?threadid=39068

  #7   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 4,391
Default Quick Interface Question

reddog9069,
All classes that Implement your interface must expose all of the routines
found in the interface.
Whilst the interface will have the signatures of the routines, these
routines will not contain any code.
What each class does within its respective routine is up to you.
After you have typed 'Implements MyInterface" as the top of a class module,
click the combo above and select "MyInterface". In the right combobox you
will now see all the routines that you need to expose.

'Interface ITest
Public Property Let MyText(vData As String)
End Property

Public Property Get MyText() As String
End Property
----------------------------------
'Class cTest
Implements ITest

Private Property Get ITest_MyText() As String
......code
End Property

Private Property Let ITest_MyText(RHS As String)
......code
End Property

That's the way I understand it anyway
I am currently making a set of barcode classes (cEAN8, cEAN13, c2Of5, etc)
that all implement the IBarcode interface: Number, size, check digit etc.
However, how each class calculates the bars for its code is class dependent.

In all, it means that I can:
Dim BarcodeInstance as IBarcode

Set BarcodeInstance = New cEAN13 'or cEAN8 or c2Of5

NickHK

"reddog9069" wrote
in message ...

I have an interface that has all abstract methods, except one method
that I want every implementation of the interface to have.

When I am implementing an interface, do I have to copy the whole
subroutine from the interface to the implementation or is there a way
to make the implementation call the interface definition of the
subroutine?

Also does anyone have a good resource for interfaces and user defined
classes in VBA because I cannot really find any good ones?

Thanks


--
reddog9069
------------------------------------------------------------------------
reddog9069's Profile:

http://www.excelforum.com/member.php...o&userid=24458
View this thread: http://www.excelforum.com/showthread...hreadid=390686



  #8   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 14
Default Quick Interface Question

scattered wrote:
reddog9069 wrote:
I have an interface that has all abstract methods, except one method
that I want every implementation of the interface to have.

When I am implementing an interface, do I have to copy the whole
subroutine from the interface to the implementation or is there a way
to make the implementation call the interface definition of the
subroutine?

Also does anyone have a good resource for interfaces and user defined
classes in VBA because I cannot really find any good ones?

Thanks


--
reddog9069


Hi,
A good reference on the use of classes in VBA is "The VBA Developer's
Handbook"
http://www.amazon.com/exec/obidos/tg...books&n=507846

I have never played around with the Implements keyword so I can't
answer your question. Maybe you could post it to a straight VB
newsgroup. You seem to be asking for something like implementation
inheritence, which is not directly supported in VB6 or VBA. There *is*
a trick involving delegation that supposedly provides a work-around,
but I honestly don't recall how it works. Maybe on a VB group (but not
the VB.Net!)you can find an answer.

Hope that helps

-John Coleman


Here is a useful link:
http://www.vbip.com/books/186100172X...er_172X_08.asp

Hope that helps

-John Coleman

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
Quick little question ben simpson Excel Discussion (Misc queries) 3 April 11th 06 02:35 PM
Quick Books interface MYC Secretary, Alice Excel Programming 1 May 4th 05 08:08 AM
User Form Interface .... really a simple question! monir Excel Programming 8 April 24th 05 08:14 PM
QUI Expert: Excel-based User Interface or OO User Interface? Michael[_27_] Excel Programming 1 November 11th 04 01:53 PM
GUI Expert: Excel-based User Interface or OO User Interface? Michael[_27_] Excel Programming 0 November 11th 04 01:20 PM


All times are GMT +1. The time now is 08:55 PM.

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"