Any chance that the string in g.tempStr is not null terminated? StrNCopy
does not null terminate if StrLen(msg) > MAX_TEMP_STR

- John Schettino
Palm OS Programming for Dummies: http://schettino/tripod.com

-----Original Message-----
From: Robert Crago [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, January 11, 2000 9:09 PM
To: [EMAIL PROTECTED]
Subject: Re: FrmCustomAlert causes crash


Jeffrey,

I'm getting a similar problem with FrmCustomAlert - but I'm sure my strings
are less than 100 bytes.

Running gremlins, my standard procedure for reporting text messages to the
user is exercised thousands of times.

But after 689,000 odd iterations I get "Read from unallocated chunk of
memory" or similar.

Pose version is 3.0a3, device emulated is Palm IIIx

Code follows:

++++++++++++++++++++++++++
Boolean alertMsg(
 Word id,
 int code)
{
 VoidHand resHdl = DmGetResource('tSTR', code);
 if (resHdl != NULL) {
  VoidPtr msg = lockMemory(resHdl, "alertMsg", true);
  if (msg != NULL) {
   StrNCopy(g.tempStr, msg, MAX_TEMP_STR);
   if (FrmCustomAlert (id, g.tempStr, " ", " ") == 0)
   {
    unlockMemory(resHdl, "alertMsg", true);
    return true;
   }
  }
 }
 unlockMemory(resHdl, "alertMsg", true);
 return false;
}
++++++++++++++++++++++++++++++++++


Do you think this may be the same error???

Please let me know if you produce a fix/workaround

Robert Crago
Revelation Computing Pty Limited
PO Box 459, ASPLEY
Brisbane, Australia 4034
-----Original Message-----
From: Jeffrey Pahren <[EMAIL PROTECTED]>
To: [EMAIL PROTECTED] <[EMAIL PROTECTED]>
Date: Wednesday, 12 January 2000 2:01
Subject: FrmCustomAlert causes crash


>I have a very straightforward call to FrmCustomAlert():
>
>FrmCustomAlert(NameAlert, FullName, " ", " ");
>
>This works properly for me 99.9% of the time.  I have one case, where
>FullName > 200 characters long, that causes a crash with the following
>message in POSE:
>
>"...just written directly to memory manageer data structures".
>
>I see nothing in the docs or books that says there is a limit on the
>length of the string being passed in.  Is there one?  If so, what is it?
>
>-jeff
>
>

Reply via email to