On 2006-12-17, Ron <[EMAIL PROTECTED]> wrote:
> Greetings,
>
> I am having trouble using FrmGetFormPtr(). I keep getting a Nil Ptr exception 
> with the following code:
> ----------------------------
> FieldPtr fldNew;
> FormPtr frmNew;
> FrmGotoForm(MainForm);
> frmNew = FrmGetFormPtr(MainForm);

Check if frmNew is a valid pointer. If the main form is not yet loaded
the code below will not work since the main form is not in memory yet.

>From the docs: FrmGotoForm() send a frmLoadEvent and a frmOpenEvent to the 
specified form. So if this code is in the beginning of your program the 
main form is not loaded yet.

> fldNew = FldNewField (
>                  (void **)&frmNew,
>                   1244,
>                   20,20,
>                   50,15,
>                   stdFont,
>                   20,
>                   true,   
>                   grayUnderline,
>                   false, false,  
>                   leftAlign,
>                   true,false,false );
> FldSetUsable(fldNew,true);
> FldSetInsertionPoint(fldNew,0);
> FldDrawField(fldNew);
> -------------------------
>

HTH

Ton van Overbeek

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

Reply via email to