Announcement

Collapse
No announcement yet.

Aggragate objects

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Thomas Tierney
    replied
    Thats an option but I am having a problem with PB returning objects in VBScript. I have an email to support on that but it has been a week now and no response.

    Leave a comment:


  • Edwin Knoppert
    replied
    Originally posted by Thomas Tierney View Post
    Hey all

    I would like to aggragate objects off of a single primary object.
    For instance, I have an object called foo with 3 object a, b and c. All of these objects have read only properties that will be drived from the main object. I can not see a way to get this information to these objects. In C++ I would pass this info view the constructor but you cant do that here..

    What were your solutions?

    Thanks
    Not sure if this is the same as inheritance?
    In my class i often add a 'backdoor' interface.
    This interface set's the values.
    Using a macro i can instantiate and set some data, then it looks a little as there was a constructor with params

    Leave a comment:


  • Thomas Tierney
    replied
    meant to say VB.NET

    Leave a comment:


  • Trevor Lane
    replied
    Originally Posted by Thomas Tierney
    Thanks Scott, I was afraid of that.. you left out two more options.. Use C++ or VB.
    VB!, I Thought the problem was that PB was only capable of dealing with COM in the same manner as VB. VB only has the default paramaterless constructor, VB does not allow inheritance per se.

    If you know how to do it in VB then you should be able to do it in PB.

    Leave a comment:


  • Scott Slater
    replied
    Originally posted by Thomas Tierney View Post
    Thanks Scott, I was afraid of that.. you left out two more options.. Use C++ or VB.
    Don't forget C#

    Leave a comment:


  • Thomas Tierney
    replied
    Thanks Scott, I was afraid of that.. you left out two more options.. Use C++ or VB.

    Leave a comment:


  • Scott Slater
    replied
    Originally posted by Thomas Tierney View Post
    Thanks for the response Scott!1

    The one problem I am having is conceptualizing setting private/read only data from the base object to the aggragate objects.

    Any thoughts?
    Unfortunately the INSTANCE variables are not inherited from the parent class (like in C++), so they cannot be directly modified from derivative classes. I think this is because PB is only following the COM spec. There are only 2 ways that I can see around this. 1) Use globals and move classes into a DLL (making the globals private to only the classes within the libary) or 2) you will have to have methods in the parent class that allow modifying the private variables (but then they're really not private are they).

    Leave a comment:


  • Thomas Tierney
    replied
    Thanks for the response Scott!1

    The one problem I am having is conceptualizing setting private/read only data from the base object to the aggragate objects.

    Any thoughts?

    Leave a comment:


  • Scott Slater
    replied
    You could create an "Initialize" method that can only be called one time right after object creation. It takes what is done in C++ and turns it into two steps. You can set an Instance variable to show that the object has been initialized so subsequent calls to the "Initialize" method would be ignored.

    Leave a comment:


  • Thomas Tierney
    started a topic Aggragate objects

    Aggragate objects

    Hey all

    I would like to aggragate objects off of a single primary object.
    For instance, I have an object called foo with 3 object a, b and c. All of these objects have read only properties that will be drived from the main object. I can not see a way to get this information to these objects. In C++ I would pass this info view the constructor but you cant do that here..

    What were your solutions?

    Thanks
Working...
X