Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Application.ActiveForm not available
Message
From
08/04/2002 10:24:29
 
 
To
08/04/2002 10:02:44
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00642128
Message ID:
00642180
Views:
13
Hi!

When you activate the shortcut menu from the method code, "this" is accessible in the commands of shortcut menu. It is easy to get path top the form and also make a code such waythat "this" will point to form. It is possible also to use a temporary public variable - reference to the form, that is created for duration of shortcut menu activation to allow use form object PEMs and objects.

In your case, as you use generic function, just pass a form reference (thisform) to the function as a parameter. When EditBox is just based on some class where that function is called, you will have an easy time to fix this - just in one place ;)

HTH.

>>>In a certain function, I am relying on property Application.ActiveForm. It used to work, but "suddenly" (may have been weeks ago, I don't know) it stopped working - the debugger tells me, can't evaluate expression Application.ActiveForm. _vfp.ActiveForm doesn't work either. And yes, a form is indeed open at that moment. What can be the reason for VFP not being able to process Application.ActiveForm? And is there any similar property, safer to use?
>>>
>>>TIA, Hilmar.
>>
>>You can try _Screen.ActiveForm.
>>
>>Did you by chance add an ActiveX control to the form? FYI, ActiveForm could be a reference to it and not the form.
>
>No, I don't have ActiveX. And I don't get the wrong object - I get "can't evaluate the expression".
>
>I tried all of the following:
>
>
>_Screen.ActiveForm
>_VFP.ActiveForm
>Application.ActiveForm
>
>
>What I do is call up a function from an EditBox. One of the menus on the right-click menu is supposed to get the data in the EditBox and send it to the default textbox editor. So, 'tis the EditBox that has the focus.
>
>In general, I find it preferable, and safer, to send a parameter to a function (e.g., ThisForm.EdbShowResults), but I didn't find a way to do this with a right-click menu item. The moment the function gets called (with on pad...), ThisForm, etc., isn't available.
>
>Of course, I could use some (temporary) public variable, but I thought ...ActiveForm should work.
>
>Hilmar.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform