Chances are that I'm completely retarded, but for some reason this isn't
working. I realized that I have to open the date book so that it will create
the database, but it's still not working. If anyone has any ideas how I can
get this to work, or what I might be doing wrong, I'd appreciate the input.
Thanks. Charles.
Err error;
UInt16 newIndex;
DmOpenRef dbRef;
//LocalID dbID;
//DmSearchStateType searchInfo;
//UInt cardNo = 0;
ApptDBRecordType newRec;
ApptDateTimeType when;
when.startTime.hours=10;
when.startTime.minutes=0;
when.startTime.hours=11;
when.startTime.minutes=0;
when.date.month=4;
when.date.day=8;
when.date.year=2001;
newRec.description = "Hello";
MemSet (&newRec, sizeof (newRec), 0);
newRec.when = &when;
/*error = DmGetNextDatabaseByTypeCreator (true, &searchInfo,
datebookDBType,sysFileCDatebook, true, &cardNo, &dbID);
dbRef = DmOpenDatabase(cardNo, dbID, dmModeReadWrite);*/
dbRef = DmOpenDatabaseByTypeCreator (datebookDBType, sysFileCDatebook,
dmModeReadWrite | dmModeShowSecret);
if(!dbRef)
{
FrmAlert(Error_Alert);
}
else
error = ApptNewRecord(dbRef, &newRec, &newIndex);
DmCloseDatabase( dbRef);
return error;
--
For information on using the Palm Developer Forums, or to unsubscribe, please see
http://www.palmos.com/dev/tech/support/forums/