Thanks Steve and Ken for the replies.  Following is a code snippet:


 // Set the standard font.  Save the current font.
 // It is a Pilot convention to not destroy the current font
 // but to save and restore it.
 currFont = FntSetFont (stdFont);

 // Get the record number that corresponds to the table item to draw.
 // The record number is stored in the "intValue" field of the item.
 recordNum = TblGetItemInt (tableP, row, column);

 // Determine the length of barcode that will fit within the bounds
 GetCurrentFieldData(recordNum, "Quantity");
 width = bounds->extent.x - 2 - FntCharsWidth(FieldDataP,
StrLen(FieldDataP));
 textLen = StrLen(GetCurrentFieldData(recordNum, "Barcode"));
 FntCharsInWidth(FieldDataP, &width, &textLen, &fits);

 // Now draw the barcode from the record
// WinDrawChars(FieldDataP, textLen, bounds->topLeft.x, bounds->topLeft.y);
WinDrawTruncChars((ConstCharPtr)FieldDataP, textLen, bounds->topLeft.x,
bounds->topLeft.y, width);


    Some background information:

- GetCurrentFieldData() sets the global pointer FieldDataP and also returns
its value
- FntCharsInWidth() seems to work fine, modifying the width, textLen and
fits variables as needed.  Even if I comment out this function and send
WinDrawTruncChars() a calculated value, I still get a Fatal Error (no error
code on the Palm - it just gives a Fatal Error with the option to reset)
- WinDrawChars(), with the same parms (except width, obviously) works fine.

    TIA!

        DP



"Ken Krugler" <[EMAIL PROTECTED]> wrote in message
news:34567@palm-dev-forum...
>
> >     Has anybody successfully used the WinDrawTruncChars() function?
>
> Yes, it's used extensively by the PIM apps.
>
> >Any
> >time that I try to use it, I get a Fatal Error.
>
> What fatal error, on which ROM/OS version?
>
> >I've tried using the
> >WinGlueDrawTruncChars() function from the PalmOSGlue library, but I get
the
> >same error.  I've checked and re-checked the parms that are being sent to
> >the function and still no luck.  So, again, I'm stumped.
>
> A code snippet would be helpful here.
>
> -- 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.palmos.com/dev/tech/support/forums/

Reply via email to