I have searched in the header files to see how this function defined. I
found datat type called "BytePtr" and the prototype defined is as follows :

UInt  SysBatteryInfo(Boolean set, UIntPtr warnThresholdP, UIntPtr
criticalThresholdP,
      UIntPtr maxTicksP, SysBatteryKind* kindP, Boolean* pluggedIn, BytePtr
percentP)
       SYS_TRAP(sysTrapSysBatteryInfo);

I have tried to use BytePtr or even Byte with an "*" to the percentage
variable I am using; It does not give me any compilation error. But when
loads the program in the emulator and calls the function from the program,
the program halts. All other functions in the program works fine except this
one.
Any Idea please ?
Thanks,


"Richard Burmeister" <[EMAIL PROTECTED]> wrote in message
news:46537@palm-dev-forum...
>
> > From: Iehab AL Rassan
> >
> > I am using code warrior light and I am trying to use
> > SysBatteryInfo function
> > that shows the percentage of the remaining battery; unfortunately,
> > percentage parameter is UInt8 and the compiler could not
> > recognize this data
> > type, it considers it as undefined data type. If I define the percentage
> > parameter as UInt16 or int, it gives me compilation error :
> > Error   : cannot convert
> > 'unsigned short *' to
> > 'unsigned char *'
> > Program1.c line 569       NULL, NULL,percentP) ;
> >
>
> I don't have CW Lite, so I can't verify this myself, but it sounds like
> UInt8 somehow didn't get defined in the CW Lite headers.  You can define
it
> yourself with:
>
> typedef unsigned char UInt8
>
> The error message, "can't convert X to Y" means the compiler was expecting
> type Y when it encountered type X.  So, you can see that your compiler
> expects the percentP to be a pointer to an unsigned char, which is a
pointer
> to a UInt8 if it has been properly defined.
>
>
>



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