Whoops, I meant FrmGetFormPtr(), not FrmGetObjectPtr().  Me bad.
(Didn't notice that I typed that until I read your reply...I've been
doing documentation all morning and I'm feeling my soul being drained
away) 

=)

Here's what I'm using as GetObjectPtr():

static VoidPtr GetObjectPtr( Word objectID )
{       
    FormPtr frmP;
        
    frmP = FrmGetActiveForm( );
    return (FrmGetObjectPtr( frmP, FrmGetObjectIndex( frmP, objectID)));
}       

It's more of a convienience function.

-Rus

>-----Original Message-----
>From: Richard Hartman [mailto:[EMAIL PROTECTED]]
>Sent: Wednesday, October 04, 2000 1:48 PM
>To: Palm Developer Forum
>Subject: Re: *&@#!! Some amazing problems !
>
>
>Huh?  FrmGetObjectPtr() is the proper way to get a form
>pointer?  Well ... no.  It's the proper way to get a pointer to
>an object that lives in a given form.
>
>I still don't see no GetObjectPtr() in the API docs.  You
>say it's in sample source code?  Perhaps the sample
>source code has (as I suggested) GetObjectPtr() as
>a wrapper for something like:
>
>    FrmGetObjectPtr(FormGetFormPtr(), FrmGetObjectIndex(ID));
>
>... but I'd have to see the code for GetObjectPtr().  It's
>gotta be somewhere since it isn't part of the actual Palm API.
>
>--
>-Richard M. Hartman
>[EMAIL PROTECTED]
>
>186,000 mi/sec: not just a good idea, it's the LAW!
>
>
>Nesse, Rustin wrote in message <26216@palm-dev-forum>...
>>
>>GetObjectPtr( blah ); is a function that is present in lots of
>>the sample source code.  It's proper use is to get the pointer
>>of an object, like a control or something, and not a form, from
>>an objectID.  FrmGetObjectPtr is the proper way of getting a
>>form pointer, also, FrmGetActiveForm( ) will get you the active
>>form's pointer as well.
>>
>>-Rus
>>
>>
>>>>Hi everybody,
>>>>    Just look to this simple code.
>>>>
>>>>/*************A simple function for setting the ****************
>>>>**************maximum value in scroll bar  ******************/
>>>>
>>>>void SetMaxScrollBar(short setVal)
>>>>{
>>>> short val=0,minVal=0,maxVal=0,pageSize=0;
>>>> ScrollBarPtr
>>>sclPtr=(ScrollBarPtr)GetObjectPtr(Resource2SkillScrollBar);
>>>
>>>What is GetObjectPtr()??  In the PalmOS API there is a
>>>FrmGetObjectPtr(),
>>>but that requires a form pointer and an object index.
>>>
>>>Now, assuming that your GetObjectPtr() wraps the overhead of
>>>getting the current form pointer, the next problem is that you need
>>>the object -index-.  I am assuming that "Resource2SkillScrollBar"
>>>is actually a resource id for the scroll bar.  You would neet to be
>>>calling FrmGetObjectIndex() to obtain the proper value to pass to
>>>FrmGetObjectPtr() ... again, that could be part of what you've got
>>>wrapped up in GetObjectPtr() ... but w/o seeing that code we
>>>are really shooting in the dark here...
>>>
>>
>>
>
>
>
>-- 
>For information on using the Palm Developer Forums, or to 
>unsubscribe, please see http://www.palmos.com/dev/tech/support/forums/
>

-- 
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