Ok, I've added a couple of new APIs. The first is a GetCSelf() API that will return the same value that would normally be passed as a CSELF argument. This is really the one you want to use for your purposes. The other API is a variant of ObjectToCSelf() that takes a starting scope for the lookup.
Rick On Tue, Sep 8, 2009 at 2:33 PM, Mark Miesfeld<miesf...@gmail.com> wrote: > On Tue, Sep 8, 2009 at 11:02 AM, Rick McGuire<object.r...@gmail.com> wrote: > >> The CSELF lookup is an unscoped lookup, so essentially, and object >> instance can only have ONE cself variable per object instance and all >> references to CSELF in any native methods will resolve to the same >> instance. > > Okay, that is what I thought. > >> If you have multiple inheritance levets setting this value, >> then the top of the inheritance hierarchy will be the one that wins >> (in your case, you'll always see the one set by the UserDialog class). > > With this chain, (which maybe is not the right order, but I thought it was) > > UserDialog -> BaseDialog -> PlainBaseDialog -> WindowBase > > UserDialog subclasses BaseDialog subclasses PlainBaseDialog inherits > WindowBase > > I only set a CSelf in PlainBaseDialog and in WindowBase. > > I thought in the native methods tied directly to WindowBase, they > would always get the CSelf set in the WindowBase init(). And in the > native methods tied directly to any of the dialog classes they would > only get the CSelf set in PlainBaseDialog. > > I thought that PlainBaseDialog would be before WindowBase in the > inheritance chain, going up, so that in UserDialog and BaseDialog they > would only see the PlainBaseDialog CSelf. > >> The CSELF is really designed for sitiations where there is just a >> single native pointer values and methods at all levels of the >> hierarchy are accessing the same value. If you wish to use multiple >> native values, you'll need to do the unwrapping yourself, For >> example, in your case, if you call GetObjectVariable('CSELF') in any >> of your init methods, you'll retrieve the value set by that level of >> the inheritance hiearchy. > > But in this case there is no CSELF set at the UserDialog level. So, I > can't do that. > > I guess it all comes down to I'm not understanding what the top of the > inheritance chain is. As I said above, for a UserDialog, I thought > PlainBaseDialog would be before WindowBase, going up the chain, so > that the PlainBaseDialog CSelf would win. > > And it does when I use the CSELF argument type in native methods tied > to a UserDialog class. > > It's just in this case where I use ObjectToCSelf(selfObj) that I get > the WindowBase CSelf, where I know that selfObj is a dialog object. > I.e. a PlainBaseObject, or one of its subclasses. > > I guess, if I was sure that ObjectToCSelf(dialogObjSelf), where I know > for sure dialogObjSelf is one of the dialog classes, would always > return the WindowBase CSelf, I could work with that. > > -- > Mark Miesfeld > > ------------------------------------------------------------------------------ > Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day > trial. Simplify your report design, integration and deployment - and focus on > what you do best, core application coding. Discover what's new with > Crystal Reports now. http://p.sf.net/sfu/bobj-july > _______________________________________________ > Oorexx-devel mailing list > Oorexx-devel@lists.sourceforge.net > https://lists.sourceforge.net/lists/listinfo/oorexx-devel > ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Oorexx-devel mailing list Oorexx-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/oorexx-devel