Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Cannot access object
Message
From
28/12/2018 11:28:48
 
 
To
28/12/2018 07:43:19
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows 10
Miscellaneous
Thread ID:
01664905
Message ID:
01664908
Views:
68
>This is new to me.
>
>I have a Tooltip class called Balloon in Balloon.vcx (home-grown, all VFP code). I add it to a form, and name it Balloon. In control's MouseEnter, I call a method in the Balloon object called Open to display the Tooltip.
>
>Some of the forms in my project perform as expected, but many others throw an error "Unknown member Balloon." I then suspend the execution, and open the debugger. Looked at the form object to see if the Balloon object is there and named correctly. Yes, it there, and shows in the Local window as an object, but it does not have the little [+] in front of the member reference. I open the Watch window, and enter a direct reference to the Balloon object. Ok, that has the [+]. Click on the [+] to expand the properties, an low-and-behold all the properties are there. But all of them have "Expression could not be evaluated." next to them.
>
>As I said, this does not occur in all the forms inherited from base class, only a few.
>The Balloon class is based on a Timer class to provide a delay before displaying the tool tip.
>I have try removing from the base class and placing it directly on the Form itself. Same error on the same forms, and works in the forms it work before.
>
>Does anyone have any idea why the object is not accessible in some places and not in others?
>
>UPDATE: My Bad. The instantiation of the Balloon object was failing, but not reporting the failure. Because the class was visually placed on the form, the reference to the class existed, but not the actual object.

That is the reason why I never RETURN .F. in the init of a control, except a form class (because you cannot drop a form on another class). I inherited a project where this RETURN .F. in the INIT is used a lot, just to make your life more difficult. Instead RETURN .F. I would set some other property to disable the object or make is invisible if it is a data entry control.
Christian Isberner
Software Consultant
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform