Hi scott,
Probably you are forgeting to lock the memory before manipulating it.
The memory manager can move handles and memory chunks for other locations in
order to optimize the memory
usage. You have to warn it that a particular chunk of memory will be used
and it should not touch it.
When allocating or accessing handles you should lock memory before using it.
This is done using the function MemHandleLock.
I think that's your problem.
As an example:
s_hRec = (Handle) DmGetRecord( s_dbMarines, s_recordNum );
if( s_hRec ) {
// Lock it and get a Ptr to a structure that represents a record. I
can be any pointer.
s_pMarines = (MarinesRecord*) MemHandleLock( s_hRec );
}
... Uses it
// release it
MemHandleUnlock( s_hRec );
ATTACHMATE CORPORATION
Dalmer Azevedo
Mobile Technologies Practice
Voice 650 962 7173
Cell 408 569 6819
-----Original Message-----
From: Scott Dattalo [mailto:[EMAIL PROTECTED]]
Sent: Friday, December 31, 1999 4:18 PM
To: [EMAIL PROTECTED]
Subject: DmGetRecord woes
Environment:
PalmIIIx rom, POSE under Linux, gcc tools
Problem:
Here's a cut-n-paste chunk of code from my Event Handler
case tblEnterEvent:
{
VoidHand h;
UInt r=1;
if(!CurrentDB)
break;
h = DmGetRecord(CurrentDB, r);
if(h)
DmReleaseRecord(CurrentDB,r,false);
handled = true;
}
break;
All this code does is select record 1 and releases it if a tblEnterEvent
occurs. I've boiled the code down to this little snippet just to exhibit
the behavior. The real goal of course, is to write to a data base record
when ever the tblEnterEvent occurs.
Unfortunately, POSE spews the dialog
"NI ir" 0.1 reports "DataMgr.c, Line:4512, Err Getting rec". If this
is the latest version of "NI ir", please report this to the application
author.
Subsequent tblEnterEvents do not always cause the dialog to appear.
Anyone have any ideas why I'm seeing this?
Regards,
Scott