This statement is the one that causes the problem FldSetTextPtr(fldStartDay, gc6DaysPriorDate);
---- only the hardware devices have been giving me >>trouble (code below) >> >>The odd thing about this is that it works on OS 5 devices, forces a soft >>reset on OS 4 devices, and has a fatal exception on OS 3.5 devices. I am >>obviously trying to find a solution that fits all three. >> >> [...] >> >>Note: I have a form set up with a textbox ID = TXTSTARTDAY. >> >>//assign fldStartDay object >>FieldType *fldStartDay; >>GetObjectPtr (fldStartDay, TXTSTARTDAY); >> >>//this puts a string with the date into gc6DaysPriorDate >>DateToAscii (dt6DaysPrior->month, dt6DaysPrior->day, dt6DaysPrior->year + >>1904, dfMDYLongWithComma, gc6DaysPriorDate); >> >>//this should assign the string from gc6... to fldStartDay. >>FldSetTextPtr(fldStartDay, gc6DaysPriorDate); >> >>//redraw object >>FldDrawField(fldStartDay); -----Original Message----- From: Henk Jonas [mailto:[EMAIL PROTECTED] Sent: Wednesday, October 27, 2004 10:09 AM To: Palm Developer Forum Subject: Re: strange fatal exception Which part does crash? Henk Ornstein, Adam wrote: > gc6DaysPriorDate is a global character array declared like this: > > char gc6DaysPriorDate[13]; > > since it is assigned a valid string value just before I set the text field, > I know that it is always available to the text box. > > The text field is a read-only field... > > So Im still stuck :( for now.... > > Thanks! > > >>Hi thanks for taking a look. only the hardware devices have been giving me >>trouble (code below) >> >>The odd thing about this is that it works on OS 5 devices, forces a soft >>reset on OS 4 devices, and has a fatal exception on OS 3.5 devices. I am >>obviously trying to find a solution that fits all three. >> >> [...] >> >>Note: I have a form set up with a textbox ID = TXTSTARTDAY. >> >>//assign fldStartDay object >>FieldType *fldStartDay; >>GetObjectPtr (fldStartDay, TXTSTARTDAY); >> >>//this puts a string with the date into gc6DaysPriorDate >>DateToAscii (dt6DaysPrior->month, dt6DaysPrior->day, dt6DaysPrior->year + >>1904, dfMDYLongWithComma, gc6DaysPriorDate); >> >>//this should assign the string from gc6... to fldStartDay. >>FldSetTextPtr(fldStartDay, gc6DaysPriorDate); >> >>//redraw object >>FldDrawField(fldStartDay); > > > Two questions: > > 1) Where is gc6DaysPriorDate allocated? Is it a global character > array? Is it a memory chunk allocated using MemPtrNew or MemHandleNew? Is > it a local array on the stack? The memory that gc6DaysPriorDate points to > has to remain valid as long as the field is around. > > 2) Is the field a read-only field? FldSetTextPtr only works for read-only > fields. If it is editable, you need to use a handle and the > FldSetTextHandle call. > -- ------------------------------------------------------------------------- Henk Jonas Palm OS (r) certified developer [EMAIL PROTECTED] www.metaviewsoft.de ------------------------------------------------------------------------- -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/ -- For information on using the Palm Developer Forums, or to unsubscribe, please see http://www.palmos.com/dev/support/forums/
