Try using MemChunkNew to allocate some memory in the storage heap. It appears
that earlier versions of MemPtrCardNo did not accept pointers in the dynamic
heap. They worked strictly against the card's bounds. For card 0, this started
at 0x10000000. Since the block you allocated appeared below this, MemPtrCardNo
displayed an error message.
-- Keith
Andreas Lang <[EMAIL PROTECTED]> on 07/18/2000 02:14:30 AM
Please respond to "Palm Developer Forum" <[EMAIL PROTECTED]>
Sent by: Andreas Lang <[EMAIL PROTECTED]>
To: "Palm Developer Forum" <[EMAIL PROTECTED]>
cc: (Keith Rollin/US/PALM)
Subject: MemPtrCardNo: problem with PalmOS below 3.1
Hello!
I'm having the following problem with MemPtrCardNo() and
PalmOS 3.0 and
2.02 (both release and debug ROMs). No problem with OS
version 3.1 and above.
Code snippet:
UInt32 freeBytes ;
MemPtr p = NULL ;
UInt16 cardNo = 0 ;
p = MemPtrNew(1) ;
cardNo = MemPtrCardNo(p) ;
// MemoryMgrNew line 2021: Invalid Chunk Ptr (line 2009 with
OS2.02)
// in POSEr 3.0a6 we're in MemPtrCardNo at 0x10c12076
(10c0b85c with
OS2.02)
MemPtrFree(p) ;
MemCardInfo(cardNo, 0, 0, 0, 0, 0, 0, &freeBytes) ;
Using MemHandleCardNo() gives the same err msg.
I obviously could call MemCardInfo() with a hard coded 0 for
CardNo but that's not what I call clean programming ...
Any hints?
Thanks, andreas
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/