Hi Henk,
I already tried out to modify the code, and it now looks like this:
FormPtr myform;
myform=FrmInitForm(SyncForm);
FrmDrawForm(myform);
FrmSetActiveForm(myform);
FrmSetEventHandler(myform, HsFormHandleEvent);
Still, I get the fatalm alert when the notification comes in and my app
isn't the running one. BTW, the form has the ID 1500, and it has two buttons
and a TBMP resource on it(1102, 1206, 1000). Can this be an overlap problem?
Best regards
Tam Hanna
Henk Jonas wrote.
Tam Hanna wrote:
> Hi you all,
> I have a program that responds to the sysExternalConnectorAttachEvent
> notification by popping up a form with an own event handler. The form pops
> up just fine with the following code:
> LocalID idx;UInt16 cardno;
> FormPtr myform;
> SysCurAppDatabase(&cardno,&idx);
> DmOpenDatabase(cardno, idx, dmModeReadWrite);
> myform=FrmInitForm(SyncForm);
> FrmSetEventHandler(myform, HsFormHandleEvent);
> FrmDrawForm(myform);
> FrmSetActiveForm(myform);
> However, in the moment that the form is on the screen, I get this fatal
> alert:
> Form68k.c, Line:1770, No form event handler
> What is happening here? I already tried to force the resource database to
> stay open(the DmOpen call), but it didn't help. Interestingly, the error
> does not occur when my app is running when the notification comes in!
> Thank you in advance for help!
> Best regards
> Tam Hanna
>
>
Hi Tam,
something like this worked for me in the following order:
FormPtr form = FrmInitForm(formID_alarm1);
if (form)
{
FrmDrawForm(form);
FrmSetActiveForm(form);
FrmSetEventHandler(form, alarm);
etc.
Regards
Henk
--
For information on using the Palm Developer Forums, or to unsubscribe, please
see http://www.palmos.com/dev/support/forums/