Also, don't declare a rectP variable and then allocate space, just say
RectangleType rect;
and use "&rect" as the pointer to this data.
On 7/6/06, Dmitry Grinberg <[EMAIL PROTECTED]> wrote:
kill this: FrmGetObjectBounds( frmP, textboxID, rectP);
use this: FrmGetObjectBounds( frmP, FrmGetObjectIndex(frmP,textboxID), rectP);
On 7/6/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
> Hi,
>
> I want to be able to draw a rectangle to the screen (1 pixel border) based on
how large one of my text fields is. This is my idea:
>
> Use FrmObjectBounds to store the bounds of the text field, then use
WinDrawRectangle to produce the rectangle. Now I don't know whether this will
work or not since im new at C programming.
>
> So far my function looks like this:
>
> void FlowTemplate1DrawBox(UInt32 textboxID){
>
> FormPtr frmP;
> RectangleType *rectP;
>
> frmP = FrmGetActiveForm();
> rectP = MemPtrNew(100);
>
> FrmGetObjectBounds( frmP, textboxID, rectP);
> WinDrawRectangle(rectP,0);
> }
>
> I get a memory error immediately saying I am trying to access an unallocated
chunk of memory. What am I doing wrong?
>
> Thank you I appreciate any help!
> --
> For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
>
--
Best Regards, Dmitry Grinberg
Software Engineer, http://PalmPowerups.com
(847) 226 9295
AIM: hacker19180
MSN: [EMAIL PROTECTED]
ICQ: 165589894
Y! IM: dmitrygr2003
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/
--
For information on using the PalmSource Developer Forums, or to unsubscribe,
please see http://www.palmos.com/dev/support/forums/