I'm trying to find out if a recurring task occurs on a particular date. I'm
able to the get the IRecurrencePattern of the task but here is where I'm
having trouble. Whenever I pass a date to the GetOccurence() method of the
IRecurrencePattern I always get false no matter how many dates I pass to it.
My code for testing the occurences is below. I'm trying to mimic the
behavior of the tasks today screen plugin that comes with the Pocket PC.
Any Ideas?
Thanks in advance,
ed
int m_range = //the number of days that I'm going to test
for(i = 0; i < m_range; i++)
{
IAppointment* pAppt2;
SYSTEMTIME st;
COleDateTime temp_date(cur_yr, cur_mo, cur_date + i, 0,0,0);
DATE st_date;
temp_date.GetAsSystemTime(st);
SystemTimeToVariantTime(&st, &st_date);
if(SUCCEEDED(pRec->GetOccurrence(st_date, &pAppt2)))
{
pRec->Release();
pAppt2->Release();
return TRUE;
}
}
return FALSE;