Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
VFP Automation Server: can't see my form
Message
From
30/12/2010 04:34:03
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows 7
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01494109
Message ID:
01494139
Views:
61
>>If it works, go with it.
>
>Craig,
>
>Can you recommend some good documentation for READ EVENTS / CLEAR EVENTS. The VFP9 documentation is pretty vague about it.
>
>When I put READ EVENTS into the Init method of my exposed class, everything just hung up. Why did that happen?

To elaborate on Craig's answer, the meaning of Read Events is "now waiting for user-initiated events". IOW, when you issue Read Events, everything you are offering to the user is visible and ready for user input (click, tab into, typing, voice commands if any - any event). Form.init() is too early, because your form doesn't exist yet - its pieces do, but the form object is still not completely created, isn't visible (unless you did something out of order during the .init()), and any variable which is to hold a reference to the form still has no value. IOW, your form is not ready yet.

The regular place for Read Events is in the code which calls the form. You have the line where you created the form and made it visible (either by createobject(), then form.show(), or by "do form" alone - which does both).

The regular place for Clear events is at the end of whatever code you run when user decides to close your app. The next line executed after it will be the line after the one where Read Events was - you have just exited the event loop, and as it goes with the loops, when you exits, it falls through to the next command after the loop.

Since you're running this as out-of-process COM, you need to have a clear idea of what is "app" in your case, i.e. what is it that your user is launching, when is it ready to communicate with the user, and when is the user done with it. If it's just this one form, try the Read Events right after the form is called and Clear Events at the end of form.release (so you don't try to exit before the form cleans up - maybe at this stage you don't have any cleanup code, but you may add some later).

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform