Hi all,

A tyical Application of mine, takes data from the
serial port, and has to display the data in the form
text field on Palm.

I tried to code it, but this is giving me an error,
and I have to reset the Palm everytime i run the
application.

Code :

case MainUnnamed1001Button:
 {
  serialPrintch(&one_byte,1);
  error=SysTaskDelay (delay);  
qtyReceive = serialGetch(buffer, sizeof(buffer),1);
error=SysTaskDelay(delay);
//      if (qtyReceive!=0)
//       FrmAlert(CantopenserialPortAlert);
if (qtyReceive) 
{
serialPrintch(buffer,qtyReceive);
}
FrmGotoForm(SecondFormForm);
//ClearField(SecondFormSecondFormReferenceFeildField);
handled = true;
}

Till this point, the application runs fine and I am
able to get the buffer displayed on my Hyperterminal.

Now, I need to put it in the text field of my second
form. the function that I am using is something of
this sort:

Void SecondFormTry(Char *buffer)
{
        FieldType  *field;
        MemHandle  memH;
        Char       *text;
        Int16      textLength=0;
        Int16      bufferLength;
        Err        error;
        
        
field =
GetObjectPtr(SecondFormSecondFormReferenceFeildField);
memH = FldGetTextHandle(field);
if (textH) {
        FldSetTextHandle(field, NULL);
        text = MemHandleLock(textH);
        bufferLength = StrLen(buffer);
if(buffer)
        {
        text="";
        while(textLength<bufferLength)
        {
        *text=*buffer;
        buffer++;
        text++;
        textLength++;
        }
        }       
}
MemHandleUnlock(memH);
FldSetTextHandle(field, memH);
        FldDrawField(field);

}

the program compiles fine, and works fine till the
first stage, in which I can send data through the
data, and echo the string to see it on my
hyperterminal. Then this application gets hung, and I
have to reset the Palm.

Any help, or Suggestions, in this regard shall be
greatly appreciated.

thanks
murali.                   

__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail
http://personal.mail.yahoo.com/

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