Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Wrapper class and access/assign problem
Message
From
09/08/2003 02:44:41
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Wrapper class and access/assign problem
Miscellaneous
Thread ID:
00818544
Message ID:
00818544
Views:
61
I'm using VFP 7.0

I created a container class that contains a hyperlink object. The container does nothing but pass along inquiries to the Hyperlink object.
Somehow when control passes to the _assign() from the _access() the object is lost.
define class myCnt as container
  oBrowser = .null.
  procedure Init()
    this.newobject( 'oHPL', 'myHPL' )

  procedure Destroy()
    .....
    some_object.oHolding = this.oBrowser
           triggers 1. myCnt.oBrowser_access()
                    2. myHPL.oBrowser_access()
                    3. myCnt.oBrowser_assign()

  procedure oBrowser_access()
    this.oBrowser = this.oHPL.oBrowser             && triggers oBrowser_assign()
    return this.oBrowser

  procedure oBrowser_assign()
    lparameters vNewVal
    this.oHPL.oBrowser = vNewVal                   && vNewVal is .null. !!!!!!!!!!!!!!!!!
    this.oBrowser = vNewVal

define class myHPL as hyperlink
  oBrowser = .null.
  procedure oBrowser_access()
    if isnull( this.oBrowser )
      this.oBrowser = createobject( 'InternetExplorer.Application' )
    endif
    return this.oBrowser
I'm guessing that it's because I'm assigning a value to oBrowser inside oBrowser_access().
Is there some other way to accomplish what I'm doing?

TIA
Bill Morris
Next
Reply
Map
View

Click here to load this message in the networking platform