At 8:24 PM +0100 27-01-00, George Lefter wrote:
>i'm a newbie in programming palms.. so i looked through some code and i
>found this function. but it doesnt seem to be in the html documentation

I've never heard of that function.

There is a FrmGetActiveForm, but you should probably not use it.  We've
uncovered lots of subtle bugs caused by code that assumes it's form is the
active form.  In fact, when there's a dialog or something open over the
top, that's not longer the case.

You can call FrmGetFormPtr(formID) to get the pointer for a known form.
(Presumably you know the form ID because that's the one you gave it in
Constructor.)  You can then call FrmGetObjectPtr, passing the formPtr from
the first function and the result of calling FrmGetObjectIndex on the ID of
the object you want.

So a safe function to do this might be (not tested code):

void * GetPtrForObjectInFormById (UInt16 formId, UInt16 objId)
{
        FormType * formP = FrmGetFormPtr(formID);

        if (formP)
                return FrmGetObjectPtr(formP, FrmGetObjectIndex(formP, objID));
        else
                return NULL;
}



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

Reply via email to