hi everybody,
i am new to palm programming. Can anybody help me how to read data from record .pdb
file ,in which i have stored BITMAP. i have written following code, but not sure i has
to be written like this or not. its not displaying bitmap on screen-
recno=0;
gDB = DmOpenDatabaseByTypeCreator('data','DIVY', dmModeReadOnly);
if( !gDB )
{
WinDrawChars("database not exist",StrLen("database not exist"), 0, 80);
return DmGetLastErr();
}
for(i=0;i<1;i++) //gives error for record no. 1 and 2
{
bitmapH = DmQueryRecord(gDB,recno);
if(bitmapH==NULL)
{ WinDrawChars("record prob",StrLen("record prob"), 0, 80);
return DmGetLastErr();
}
if (bitmapH)
{
bitmap = (BitmapPtr)MemHandleLock(bitmapH);
WinDrawBitmap(bitmap, 10, 10);
MemHandleUnlock(bitmapH);
recno++;
}
}
in Simulator "view > database" it is showing 3 records, but for record 1 and 2 it
gives error, thats why i have written i<1 in for Loop.
thanks
divyanshu
Get Your Private, Free E-mail from Indiatimes at http://email.indiatimes.com
Buy The Best In BOOKS at http://www.bestsellers.indiatimes.com
Bid for for Air Tickets @ Re.1 on Air Sahara Flights. Just log on to
http://airsahara.indiatimes.com and Bid Now !
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/support/forums/