"Brian Mathis" <[EMAIL PROTECTED]> wrote in message
news:13985@palm-dev-forum...
> One thing that I'd like to do is control the form that is open just
> before receiving a beam.

The receiver doesn't generally have to be running a particular app, or be in
a particular form. What happens when a beam comes in is:

1. The app is sub-launched with the sysAppLaunchCmdExgAskUser launch code.
You may not have access to globals. If you don't handle this, the Exchange
Manager will put up a default "do you want to accept" dialog. If you do
handle this, you should put up your own dialog or use ExgDoDialog. Your app
isn't running around its event loop; it's waiting for a call to EvtGetEvent
or SysHandleEvent (I forget which) to return.

2. The app is sub-launched with the sysAppLaunchCmdExgReceiveData launch
code. You may not have access to globals. It should call ExgAccept,
ExgReceive as necessary, and ExgDisconnect. It can set the goto info for the
next step. If it doesn't, the next step is skipped.

3. The app is launched with the sysAppLaunchCmdGoTo launch code. You DO have
access to globals. The goto info is whatever you specified in step 2. This
is the point when you normally change forms.

> What I want to happen, as the beam receive comes in and the "info form" is
the
> active form, is to have the app return to the main form before starting to
> receive the data.

You should wait for the goto before switching forms.

> // see if this app is running
> if(launchFlags & sysAppLaunchFlagSubCall) {
> // if it is, close any info windows that might be open
> if(FrmGetActiveFormID() == InfoForm) {
> FrmReturnToForm(MainForm);
> }
> }
> // start receiving the data
> error = RecvDatabase(exgSocketP);

This won't work because you app's event loop is locked up, so it'll never
get the events that were queued by FrmReturnToForm.

Why do you want to go to the main form before receiving? I can see that you
might want to save any changes in the current form.
--
Danny Epstein
OS Engineer, Palm Inc.



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to