Hi, thanks for the reply. Yes, i do initialize the offset as 0.

The following is the snippet code:


void PackRecord(PhoneInfoDBPackedRecordType *s, PhoneInfoDBRecordType r)
{
    UInt16 size;
    char zero = 0;
    UInt32 offset = 0;

   DmWrite(s, offset, &r.flag, sizeof(r.flag));
   offset+=sizeof(r.flag);

 DmWrite(s, offset, &r.DOB, sizeof(r.DOB));   // The problem started here
 offset+=sizeof(r.DOB);

- - - -

}

Pls advise


                                                                                       
        
                    "kurakular2000"                                                    
        
                    <kurakular2000@ya        To:     [EMAIL PROTECTED]         
        
                    hoo.co.in>               cc:                                       
        
                                             Subject:     Re: dmErrWriteOutOfBounds 
when       
                    10/03/2002 05:23         DmWrite                                   
        
                    PM                                                                 
        
                                                                                       
        
                                                                                       
        



Initially offset should be set to 0 but it seems ur writing directly
without initialising offset.
--- In [EMAIL PROTECTED], [EMAIL PROTECTED] wrote:
> Hi.
>
> I have encountered an error where i would like to write a date type
to my
> DB.
>
> type struct DATE
> {
>   UInt8 day;
>   UInt8 month;
>   UInt16 year;
> };
>
> in the PackRecord function:
>
> DmWrite(s, offset, &r.DOB,sizeof(r.DOB));         // where DOB is a
DATE
> type.
> offset+=sizeof(r.DOB);
>
> I use the DmWriteCheck and found this error: dmErrWriteOutOfBounds.
> Basically we define the data size of the particular data, it should
be
> alright, right?
>
> Could someone help me??? Do appreciate with your help.
>
>
> --
> For information on using the Palm Developer Forums, or to
unsubscribe, please see http://www.palmos.com/dev/support/forums/






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

Reply via email to