Guys

I can't figure that one out. The following code works fine when pForm points
to my program's own form but crashes when pForm points to a different form.

FormType* pForm = FrmGetActiveForm();
char* pOld = (char*)FrmGetTitle(pForm);
char* pNew = (char*)MemPtrNew(6);
MemSet(pNew 6, 0);
MemMove(pNew, "Title", 5);
FrmSetTitle(pForm, pNew);

The crash occurs on the last line.

My program interrupts whatever program is running, carries-out some action
on the active form and then returns control to the running program. The
above code fragment is taken gets executed just before my program enters its
own event loop and waits for the user to select something on the active
form. The idea is to set the form's title tpo something new to let the user
know that the program is waiting for a stylus tap.

Could well be that the pointer returned by MemPtrNew() is valid for my
program's own form but not for any other form. How can I get a pointer that
will be valid throughout the system (i.e. nol matter what program it gets
passed to)?

Regards

Patrick



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

Reply via email to