----- Original Message -----
From: "Richard M. Hartman" <[EMAIL PROTECTED]>

>
> Richard Burmeister wrote in message <33285@palm-dev-forum>...
> >
> >From: "Anuradha J" <[EMAIL PROTECTED]>
> >
> >>     // get label on the button
> >>     cLabel = CtlGetLabel(control);
> >>
> >>     if(*cLabel == '\0')   // this is were it gives problem
> >
> >The docs say you must not use CtlGetLabel on a graphical control or a
> slider
> >control because they have no label (and therefore, I would guess that
> cLabel
> >is NULL).  So you should check the control type before calling
CtlGetLabel
> >(or, at least don't try to dereference cLabel if it is NULL!).  I don't
see
> >any API function to check a control's type, so you probably have to look
to
> >see if control.ControlAttrType.graphical is set and not call CtlGetLabel
if
> >it is.  Note: the graphical attribute is only present if the 3.5 New
> Feature
> >Set is present.
> >
>
> Wouldn't it work to check for (cLabel == NULL) instead
> of checking for an empty-but-allocated label?
>

Richard - that's what I was suggesting when I said "don't try to dereference
cLabel if it is NULL!"

>
> --
> -Richard M. Hartman
> [EMAIL PROTECTED]
>
> 186,000 mi/sec: not just a good idea, it's the LAW!

    -- unless you understand tunneling!



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