The first thing to check would be if the ObjIndex is actually the index of a "Control" or some other kind of form element. Controls are buttons, checkboxes, triggers, etc, but NOT labels for instance. Bob.

Manpreet Singh wrote:

I am facing a strange problem for the last two months in my application,
when I try to debug on palm os emulator 4.21,
Palm emulator flags an error "myapp(1.0) called SysFatalAlert with the
message "Control.c line:543 "Not a Control Object"
What I am trying to de is just setting the label to a new text string.
Running on simulator 5.0 or tungsten W/T does sometimes stops at that line
but again sometimes goes well .......  :0(

Here is the code:

Please help if anybody know what could be the reasons.

void ToolsDrawControl(FormPtr frmP,char* label, UInt16 ObjIndex)
{
ControlPtr ct=NULL;
if(label)
// if(label!=NULL)
{
 UInt16 index;
 //int pt;

 index = FrmGetObjectIndex(frmP,ObjIndex);
 //pt = FrmGetObjectType(frmP,ObjIndex);

 if (index == frmInvalidObjectId)
  ErrAlertCustom(ErrOKAlert,""," ToolsDrawControl-Invalid Control Specified
", label);

 ct = FrmGetObjectPtr(frmP,index);
 if(ct)
 {
  //CtlSetUsable(ct,false);
  CtlSetLabel(ct,label);
  //FrmCopyLabel(frmP, ObjIndex, label);
 }
}
}

Regards,
Manpreet
Drish Infotech Ltd.







--
For information on using the Palm Developer Forums, or to unsubscribe, please 
see http://www.palmos.com/dev/support/forums/

Reply via email to