Pass Class reference of unkown class 
Author Message
 Pass Class reference of unkown class

I want to pass a reference of a class module from one class module to
another.  That's easy if the receiving class knows which class to except
i.e.:

Public Property Set objBiz (byRef obj as clsTestClass) 'clsTestClass is a
class module

    Set objBusiness =obj

End Property

But what if the receiving class could receive one of several different class
modules into the same variable such as the module behind several different
forms (one at a time of course).  Is this possible with out declaring
exactly what class is expected?  If I were working with standard modules, I
could do something like:

    (byRef obj as module)

Thanks.

George Padvorac



Tue, 21 Aug 2001 03:00:00 GMT  
 Pass Class reference of unkown class


Quote:
> But what if the receiving class could receive one of several different class
> modules into the same variable such as the module behind several different
> forms (one at a time of course).  Is this possible with out declaring
> exactly what class is expected?  If I were working with standard modules, I
> could do something like:

What you're looking for is interface inheritance, sounds like to me. And
that's not available in this version of Access.  It is in VB5 and VB6,
and will be in Office 2000 (using the Implements keyword).

For now, the best you can do is declare your variable As Object, and then
work with it that way. -- Ken



Tue, 21 Aug 2001 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Class of control was not a loaded control class - Reference Replaced with unknown .OCA file

2. referencing classes in other classes

3. Pass integer Value from forms Class mod to report class mod

4. Passing Classes to other classes (using user defined types)

5. pass by reference and classes

6. VBScript Class and Pass by Reference question

7. HELP: Passing class variables by reference ?

8. Please explain this behaviour: passing control reference to a class

9. passing a reference (control array) to a class

10. Dim obj As New Class crt Dim Obj As Class = New Class

11. derive class from protected class in base class

12. Exposing Properties collection in custom classes as many MS Classes do

 

 
Powered by phpBB® Forum Software