I'm programming quite a complex thing in VBA I think and even though I did a lot of research I couldn't come up with a solution to my problem so far. And unfortunately I'm no expert :)
I have two classes, e.g. clsBuilding and clsFactory, which both have an instance of clsHeatDemand. Now I'm trying to implement a parent-Property to access some values from the base classes I need for the calculation, based on this idea.
Friend Property Get Parent() As clsBuilding
Set Parent = ObjFromPtr(parentPtr)
End Property
Friend Property Set Parent(obj As clsBuilding)
parentPtr = ObjPtr(obj)
End Property
My problem now is that the parent can be of two different types even though they have the same parameters I need. So what I'm trying to ask is if there is a way to hand over the instances simply as obj As Object and still access its properties?
I also tried this with Interfaces but I would be happy if there is another easier solution.