Anyone know why this piece of code would cause a fatal exception on a real
handheld (Palm V) but not on POSE running the same ROM?
void DL_SetLocation(DrawLibType *dl, Int16 x, Int16 y, Int16 w, Int16 h)
{
Char buf[80];
Char buf2[80];
StrPrintF(buf, "%d %d", dl->rect.topLeft.x, dl->rect.topLeft.y);
StrPrintF(buf2, "%d %d", dl->rect.extent.x, dl->rect.extent.y);
/* the next call displays four values, junk of course */
FrmCustomAlert(GEN_USER_ERROR_ALERT, "SetLocation", buf, buf2);
dl->rect.topLeft.x = x; // exception occurs here
FrmCustomAlert(GEN_USER_ERROR_ALERT, "Set X", buf, buf2);
dl->rect.topLeft.y = y;
FrmCustomAlert(GEN_USER_ERROR_ALERT, "Set Y", buf, buf2);
dl->rect.extent.x = w;
FrmCustomAlert(GEN_USER_ERROR_ALERT, "Set W", buf, buf2);
dl->rect.extent.y = h;
FrmCustomAlert(GEN_USER_ERROR_ALERT, "Set H", buf, buf2);
}
As I've indicated the values for x & y of the rectangle can be accessed, but
not assigned to, even though this line earlier on causes no problems:
MemSet(&dl->rect, sizeof(dl->rect), 0);
The definition of DrawLibType is as follows:
#define MAX_BUFFER_LINES 30
#define MAX_LINE_WIDTH 35
typedef struct _DrawLibType {
Char textBuffer[MAX_BUFFER_LINES][MAX_LINE_WIDTH];
RectangleType rect;
} DrawLibType;
Like I said, the code runs fine on POSE and causes a fatal exception on a
real unit.
Anyone have any ideas?
Simon.
--
This message brought to you by the gateway to a dimension of hairy monkeys.
Simon Drabble It's like karma for your brain.
[EMAIL PROTECTED]
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/