Hi all,

  I have developed a database application for palm. I
have a structure in my code as follows:

typedef struct {

char a [25] ;
int b ;
char c[16][10] ;
} MyStruct ;

 Now on the desktop, I have a conduit running. It
synchonizes all my database correctly except that I am
not able to parse this structure from the raw record
class.

  I have the following code to do the same:

void WriteDB1 ( CRawRecordInfo & rInfo )
{
  void  *pBuff = NULL ;
  char te[5] = {'\0'} ;
  char tempe[15] = {"\0"};
        
  WORD ts = 0 , len = 0 , i = 0 ;
  pBuff = ( char * )rInfo.m_pBytes ;
        
  LogAddEntry(( char *)pBuff,slWarning,true);

  len = 26 + 1 ;

  pBuff = ( void * )( rInfo.m_pBytes + len ) ;

  ts = SyncHHToHostWord ( *(WORD *)( pBuff )) ;
        
  LogAddEntry(itoa ( ts, te, 10 ),slWarning,true);

  len += sizeof(WORD);

  pBuff = ( char * ) ( rInfo.m_pBytes + len ) ;

  LogAddEntry(( char *)pBuff,slWarning,true);

  while ( i < NUMBER_OF_RESPONSES ) 
  {
        i++ ;
                
        len += 10 + 1 ;

        pBuff = ( char * ) ( rInfo.m_pBytes + len ) ;
        LogAddEntry((char *)pBuff,slWarning,true);

  }     
  return ;
}

 
  The above code just prints out the first value of
the member: MyStruct[0] 

  All the remaining values show junk. Can anyone
please help me out with this. Is there any better way
to do the same. Thanks in advance,

Regards,

Amit


=====
" TOUGH TIMES DO NOT LAST LONG BUT TOUGH PEOPLE DO "

__________________________________________________
Do You Yahoo!?
Yahoo! GeoCities - quick and easy web site hosting, just $8.95/month.
http://geocities.yahoo.com/ps/info1

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