Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

ITask and IRecurrencePattern

0 views
Skip to first unread message

ed

unread,
Apr 4, 2005, 10:57:03 AM4/4/05
to
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;

Peter Foot [MVP]

unread,
Apr 4, 2005, 4:23:14 PM4/4/05
to
Prior to Windows Mobile 2003 you must call GetOccurrence with the full date
and time of the occurrence. From WM2003 onwards you can pass just the date.

Peter

--
Peter Foot
Windows Embedded MVP
http://www.inthehand.com | http://blog.opennetcf.org/pfoot/

"ed" <e...@discussions.microsoft.com> wrote in message
news:9408A28B-BEE8-4813...@microsoft.com...

0 new messages