Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can't see object's member
Message
 
To
13/04/2006 15:54:45
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
01113591
Message ID:
01113682
Views:
14
Hi Tammar,

How you create form?

I know only one case with this behavior (time at time)... If object instance is saved to cell protected array in another object/class.

MartinJ

>Got a really weird one here. I'm working on some framework code.
>
>I have a property of the application object called oActiveForm. I've used BindEvent() to call app object methods (SetActiveForm, ClearActiveForm) from form Activate and Deactive to keep this property updated. (IOW, the forms don't have to know anything about the app object.)
>
>I have a toolbar class that binds to those app object methods so that the toolbar can always know what form is active. The Init of the toolbar class contains this code:
>
>
>LPARAMETERS oCallingForm
>
>* Reset enable/disable of controls when active form changes
>IF VARTYPE(goApp) = "O" AND PEMSTATUS(goApp, "ClearActiveForm", 5)
>	* Disconnect from old form
>	BINDEVENT(goApp, "ClearActiveForm", This,"UnbindActiveForm",1)
>ENDIF
>IF VARTYPE(goApp) = "O" AND PEMSTATUS(goApp, "SetActiveForm", 5)
>	* Connect to new form
>	BINDEVENT(goApp, "SetActiveForm", This,"BindToActiveForm",1)
>ENDIF
>
>* Bind to current form
>IF VARTYPE(m.oCallingForm) = "O" AND NOT ISNULL(m.oCallingForm)
>	This.BindToActiveForm(m.oCallingForm)
>ENDIF
>
>
>
>
>The BindToActiveForm method contains this code (with lots of debugging code added right now):
>
>
>LPARAMETERS oForm
>
>* Bind updating of controls to updating on active form
>DEBUGOUT PROGRAM()
>DEBUGOUT "goApp.oActiveForm = ", IIF(not ISNULL(goApp.oActiveForm), goApp.oActiveForm.Name, "null")
>
>DO CASE
>CASE VARTYPE(m.oForm) = "O" AND NOT ISNULL(m.oForm)
>	DEBUGOUT "Binding form ", m.oForm.Name
>	BINDEVENT(m.oForm, "UpdateEnabled", This, "UpdateEnabled", 1)
>	
>CASE VARTYPE(goApp) = "O" AND VARTYPE(goApp.oActiveForm) = "O" AND ;
>   NOT ISNULL(goApp.oActiveForm) AND ;
>   PEMSTATUS(goApp.oActiveForm, "UpdateEnabled", 5)
>	DEBUGOUT "Binding form ", goApp.oActiveForm.Name
>	DEBUGOUT "Ready to check members"
>	IF VARTYPE(goApp) = "O" AND VARTYPE(goApp.oActiveForm) = "O"
>		DEBUGOUT "Form is ", goApp.oActiveForm.Name
>		DEBUGOUT "Checking members"
>		LOCAL aOFM[1]
>		nCount = AMEMBERS(aOFM, goApp.oActiveForm, 1)
>		DEBUGOUT nCount, " members found"
>	ELSE
>		DEBUGOUT "Can't check members"
>	ENDIF
>	DEBUGOUT "Checked members"
>	BINDEVENT(goApp.oActiveForm, "UpdateEnabled", This, "UpdateEnabled", 1)
>
>OTHERWISE
>	DEBUGOUT "No binding"
>ENDCASE
>
>
>The code keeps failing on the BindEvent() call in the second CASE with the error "Property 'UpdateEnabled' is not found".
>
>Here's the weird part (other than the fact that I just checked for the property in the CASE statement). If I suspend and check PEMSTATUS() for the method, it's there. The AMEMBERS() call, which I added to try to see what was going on, only finds two members--Name and Class, which I used in DEBUGOUT in another method. IOW, this object is behaving like COM objects do in the Debugger; only previously referenced properties show up.
>
>Anybody have any idea what would cause this or how I can work around it?
>
>Tamar
"Navision is evil that needs to be erazed... to the ground"

Jabber: gorila@dione.zcu.cz
Jabber? Jabbim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform