unless you built GCC yourself, your version is almost certainly 0.50 and
does not handle callbacks correctly, and does require the use of
CALLBACK_PROLOGUE/EPILOGUE.
perhaps the RowID is not initialized correctly? or maybe MyDB hasn't been
initialized yet (perhaps the execution order is slightly different on OS2)?
----- Original Message -----
From: Thomas Ward <[EMAIL PROTECTED]>
To: 'Palm Developers Forum List' <[EMAIL PROTECTED]>
Sent: Saturday, September 18, 1999 10:26 AM
Subject: DmQueryRecord Crashing on Palm Professional
> Hi all,
>
> I have some code that seems to run fine on everything except a Palm
> Professional:
>
> static void table_draw_cell(VoidPtr table, Word row, Word column,
> RectanglePtr bounds) {
> VoidHand recordH;
>
> recordH = DmQueryRecord(MyDB, (UInt) TblGetRowID(table, row));
>
> ...
> }
>
> I have the global definition:
>
> DmOpenRef MyDB;
>
> On the Emulator, I get that my application "has just read directly from an
> unallocated chunk of memory" when it tries to execute the DmQueryRecord.
>
> If I run the same code emulating a Palm III, it works just fine.
>
> I thought it might have to do with GCC and CALLBACK_PROLOGUE and
> CALLBACK_EPILOGUE. I've never used these, and everything has always worked
> just fine without them, so I assume that the version of GCC I'm using has
> fixed this problem. (How can I tell what version of GCC I have?)
>
> Anyway, I tried adding CALLBACK_PROLOGUE and CALLBACK_EPILOGUE to this
> routine, but it still crashed.
>
> Anybody have any ideas why this would work fine on a PalmIII but not on a
> PalmProfessional? Thanks in advance,
>
> Tom
>
>