Found the bug. To fix it I had to modify Codejock code in 1 place, I need to make sure this change gets migrated into the toolkit for the next release.
The problem was apparently limited ONLY to recurring appointments with no end date. We finally discovered that Exchange Server was spitting back some cryptic, undocumented, error code that suggested it didn't like something about the data in the local record. Further examination revealed that when the toolkit writes this out, the "no end date" status causes an end date of 1 Jan 9999 for both the appointment, and the pattern end dates. When Outlook writes out these same dates in this situation, the appointment end date is set to the end date/time for the first instance of the appointment, and the pattern end date/time is set to 31 Aug 4500, 11:59:00 PM. Further testing shows that exchange server just doesn't like the insane appointment end date, and doesn't care about the recurrence end date
Since this is only an issue when the code writes the data to outlook, the solution is to check for this condition when we write and nowhere else.
Inside CXTPCalendarMAPIDataProvider::UpdateMAPIEvent we find the following code:
//- recurrence Start/end ---------------------------------------------- nPropTag = m_MapiHelper.GetPropTagByID(pMessage, xtpMAPIpropEvent_RecurrenceStart); VERIFY(_setPropTagVal_UtcTime(pMessage, nPropTag, stUTCstart));
nPropTag = m_MapiHelper.GetPropTagByID(pMessage, xtpMAPIpropEvent_RecurrenceEnd); VERIFY(_setPropTagVal_UtcTime(pMessage, nPropTag, stUTCend));
|
Just after it, insert the following:
if (((CXTPCalendarRecurrencePattern*)ptrPattern)->GetUseEndMethod() == xtpCalendarPatternEndNoDate) { // the end date set above was for 1 Jan 9999, which is fine for Outlook // but at least some versions of exchange server don't like it. Outlook // sets the end date to the end date/time of the first instance of the // pattern in this case, so that should work fine for us. // ------- Fixed EndTime -------- int nDuration = RCData.dwOccEndTime - RCData.dwOccStartTime; dtTmp = pEvent->GetStartTime() + COleDateTimeSpan(0, 0, nDuration, 0); stUTCend = xtp_TimeToUtc(dtTmp); ASSERT(stUTCend.wYear); nPropTag = m_MapiHelper.GetPropTagByID(pMessage, xtpMAPIpropEvent_EndTime); VERIFY(_setPropTagVal_UtcTime(pMessage, nPropTag, stUTCend)); }
|
|