Hi,

I have a record struct with three members in it. i.e:   typedef MyStructType
                                                        {
                                                        char LineNo[5];
                                                        char In[10];
                                                        char Out[10];
                                                        char Eff[3];
                                                        }EffInfoType;

                                                        typedef MyStructType
* MyStructPtr;          


 Since I'm not familiar with conduits i thought I'll initialise about 3
stucture's and store it in the Palm database. So I could try retrieving them
and get my logic right. But i dont seem to get the initialise records stored
in the database.Can some one go through the code and let me know where I
have gone wrong.



-> Method to store the Sample data 

extern void SaveRecords(void)
{
        MyStructPtr newPtr,MyRecordPtr;
        VoidHand        textHandle;
        UInt            index = 0,i=0;          

        for (i = 0; i < 4; i++) 
        {
                
                newPtr = InitRecord();
                textHandle = DmNewRecord(EffDB, &index, sizeof(newPtr));

                MyRecordPtr = MemHandleLock(textHandle);
        
                DmWrite(MyRecordPtr, 0, &newPtr, sizeof(newPtr));

                MemHandleUnlock(textHandle);
        
                DmReleaseRecord(EffDB, index, true);
        }
}


-> Code for IntRecord

extern EffInfoPtr EffInitRecord(void)
{
        MyStructType rec = {"line",
                                           "100000",
                                           "100000",
                                           "99"};
                
        return &rec;
}


Thanks in Advance

Dhanushka

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