Rajesh Patidar wrote in message <26209@palm-dev-forum>...
>
>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...

> SclGetScrollBar(sclPtr,&val,&minVal,&maxVal,&pageSize);
> SclSetScrollBar(sclPtr,val,minVal,setVal,pageSize);
> return;
>}
>
>I am calling this function like this-->
>SetMaxScrollBar(20);
>
>Now when I debug this program, in the function niether the values of val,
>minVal, maxVal or pageSize sets to zero ( in initializing part) nor the
>parameter setVal changes to the argument value(ie. 20).Furthermore in whole
>function  values don't change(no effect of SclGetScrollBar() function! They
>stuck to -1).
>    I am totally confused with this behaviour of the program.
> In fact I tried this also-->
>/**************************************************/
>void SetMaxScrollBar(short setVal)
>{
> short val=0,minVal=0,maxVal=0,pageSize=0;
>//
>setVal=200; // No any effect of this statement !
>
>return;
>}
>Can anybody point out my/system's mistake in this case?
>


--
-Richard M. Hartman
[EMAIL PROTECTED]

186,000 mi/sec: not just a good idea, it's the LAW!




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