Sorry for repeating the message. I do surf some web and understand that not
all palm devices have the serial number. I got this error may be due to the
palm device does not have the serial number (i've tried oredi by simply
retrieving the number from the palm device). In this case, the code of
retrieving palm serial number does not apply to this case???? So how are we
going to verify the application where we need to extract someone's palm
serial number for verification?? (sorry for bringing up this issue since i
know it's been discussed for quite some times but yet, i'm not able to find
the discussion)

Any idea of it???
"quennie" <[EMAIL PROTECTED]> wrote in message
news:77265@palm-dev-forum...
>
> Hi..all.... i'm going to retrieve the palm serial number programmatically.
i
> found the code from the falch.net help file and it compiles smoothly.  But
> when i run the program, it gives me the error: "The application just wrote
> to memory location 0x00084A52, which is in the storage heap. In order to
> protect the integrity of the user's data, such direct access is not
allowed.
> Instead, application should use special palm OS functions for this
purpose"
>
> The following code:
>
> static void DrawSerialNumOrMessage(Int16 x, Int16 y, Char*
noNumberMessage)
> {
> Char* bufP;
> UInt16* bufLen;
> Err retval;
> Int16 count;
> UInt8 checkSum;
> Char checksumStr[2];
>
>
> retval = SysGetROMToken (0, sysROMTokenSnum,(UInt8**) &bufP, bufLen);
> if ((!retval) && (bufP) && ((UInt8) *bufP != 0xFF)) {
> checkSum = 0;
> for (count=0; count<*bufLen; count++)
> {
> checkSum += bufP[count];
> checkSum = (checkSum<<1) | ((checkSum & 0x80) >> 7);
> }
> checkSum = ((checkSum>>4) & 0x0F) + (checkSum & 0x0F) + 2;
>
> WinDrawChars(bufP, *bufLen, x, y);
> x += FntCharsWidth(bufP, *bufLen);
>
> // draw the dash and the checksum digit right after it
> checksumStr[0] = '-';
> checksumStr[1] =
> ((checkSum < 10) ? (checkSum +'0'):(checkSum -10 +'A'));
> WinDrawChars (checksumStr, 2, x, y);
> }
> else // there's no serial number
> // draw a status message if the caller provided one
> if (noNumberMessage)
> WinDrawChars(noNumberMessage, StrLen(noNumberMessage),x, y);
> }
>
>
>
> i called the program from the
> static int StartApplication(void)
> {
>
> Int16 x =10, y = 50;
> Char *Msg;
>
> DrawSerialNumOrMessage(x, y, Msg);
>
> }
>
> can i do this by this way??? pls help me.
> Thank you very very much
>
>
>
>
>



-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palmos.com/dev/tech/support/forums/

Reply via email to