At 12:00am -0800 00-03-02, Palm Developer Forum digest wrote:
>Subject: TxtPrepFindString crash
>From: Richard Bram <[EMAIL PROTECTED]>
>Date: Wed, 1 Mar 2000 22:54:16 -0600
>X-Message-Number: 62
>
>I am having a problem with TxtPrepFindString() on the Emulator with
>the color OS3.5 ROM. (English, DR 4, nondebug). Is it supposed to
>work correctly? I keep getting a crash with error saying "Textmgr.c
>line 945 Dest buffer too small".

Darn - I guess this means that the Palm OS 3.1 SDK shipped with 
TxtPrepFindString documented, right?

I thought it was private, and changed the API between 3.3 and 3.5. 
And yes, to keep from getting flamed, I wrote a TxtGluePrepFindString 
routine for the Palm OS Glue library that does the right thing based 
on the version of the OS.

So if you've got the 3.5 SDK, use that glue routine. Otherwise you'll 
need something like the following snippet of code:

UInt16 NewPrepFindString(const Char* inSrcP, UInt16 inSrcLen, Char* outDstP,
                        UInt16 inDstSize)
        INTL_TRAP(intlTxtPrepFindString);

and then

        FtrGet(sysFtrCreator, sysFtrNumROMVersion, &version);
        if (version < sysMakeROMVersion(3, 5, 0, 0, 0))
                {
                TxtPrepFindString(inSrcP, outDstP, inDstSize);
                }
        else
                {
                NewPrepFindString (inSrcP, StrLen(inSrcP), outDstP, inDstSize);
                }

Note that this doesn't work on pre-3.1 devices, but the 
TxtGluePrepFindString routine does handle this properly, so use it 
when you get the 3.5 SDK.

-- Ken

Ken Krugler
TransPac Software, Inc.
<http://www.transpac.com>
+1 530-470-9200

-- 
For information on using the Palm Developer Forums, or to unsubscribe, please see 
http://www.palm.com/devzone/mailinglists.html

Reply via email to