Problem with RecurrencePattern::GetOccurrence

C

Chuck Bohling

I'm trying to create exceptions to a recurring appointment. I create a daily
recurring appointment and save it. Then reopen it, do a
GetRecurrencePattern, then a GetOccurrence, change the Subject, save the
exception and save the parent/owner appointment. If the number of exceptions
is small, 140 with outlook 2003, everything is fine. But if the number is
about 150, outlook does not show the appointment or any of the exceptions.
With outlookspy I can see the attachment table and all the exceptions are
there. I can OpenProperty on them. Outlook simply doesn't display them. Any
idea what is wrong and how to fix the problem?
 
C

Chuck Bohling

Thanks. Here's the code . If the number of exceptions is less than 140, all
appointment items show in outlook's "day/week/month" view. But if the number
is something like 150, nothing shows in the view. However, the exceptions
are in the message's attachment table and look valid.

_AppointmentItemPtr appt = m_pApp->CreateItem(olAppointmentItem);
appt->Subject = "test";

COleDateTime today(2005, 9, 6, 0, 0, 0);
appt->Start = today + COleDateTimeSpan(0, 16, 0, 0);
appt->End = appt->Start + COleDateTimeSpan(0, 1, 0, 0);

RecurrencePatternPtr recurPat = appt->GetRecurrencePattern();
recurPat->RecurrenceType = olRecursDaily;
recurPat->PatternStartDate = today;

appt->Save();

appt =
m_pApp->GetNamespace(L"MAPI")->GetDefaultFolder(olFolderCalendar)->Items->Item(1);
recurPat = appt->GetRecurrencePattern();

// if i < 140, appointments show in outlook's "day/week/month" view
// if i > 140 or so, appointments do not show in outlook's
"day/week/month" view
// in all cases, appointments show in MAPI attachment table and in
outlook's "by category" view

for (int i = 0; i < 150; i++)
{
_AppointmentItemPtr exception = recurPat->GetOccurrence(appt->Start +
COleDateTimeSpan(i, 0, 0, 0));
CString cs;
cs.Format("%d", i);
exception->Subject = (bstr_t)cs;
exception->Save();

appt->Save();
}
 
K

Ken Slovak - [MVP - Outlook]

Is the problem that you can't retrieve the exceptions past that limit or
that the Outlook view won't show them in day/week/month view? If it's a view
problem then it's not a code problem but a limitation with the view.

Is this running on an Exchange server? If so you might be running into a
limitation of how many open RPC channels can be opened to the server, which
can be changed by changing a registry setting on the server.
 
C

Chuck Bohling

The problem is that Outlook's day/week/month view doesn't display them.
They're there, just not displayed. As far as I can tell it's an outlook bug.
I was hoping someone might have a workaround. I tried both exchange and .pst
and they have the identical problem. It actually has something to do with
the size (in bytes) of the exceptions, not the number.
 
K

Ken Slovak - [MVP - Outlook]

Then I can't help you and I doubt anyone can. You can try creating a new
custom view and see if that works, otherwise you're stuck.
 
S

Stephen Griffin [MSFT]

Chuck,
Have you narrowed down a property and a size associated with this problem?
It may be a scenario where we need to use OpenProperty to fetch some data
but we're using GetProps instead. We've fixed a few of those recently. Given
a property number (or name if it's a named prop) I can look to see if this
is something we've already fixed.

Steve
 
S

Stephen Griffin [MSFT]

Yeah - with binary props we can only get so much via GetProps - anything
larger and we need to switch to OpenProperty and a streaming interface.
 
C

Chuck Bohling

Looks like a GetProps size problem (8K??) with RecurrenceState (0x8216).
With the test code below, 140 exceptions have a RecurrenceState size of 7762
bytes. But with 150 exceptions, the size is 8332. In that case, OutlookSpy
shows MAPI_E_NOT_ENOUGH_MEMORY. All the exceptions are present in the
attachment table.
 
S

Stephen Griffin [MSFT]

I had to create over 240 exceptions before I got an error
(MAPI_E_CALL_FAILED) trying to save. I never saw a rendering problem though

I'm running Outlook 2003 - outllib.dll ver 11.0.6516.0. What are you
running?
 
C

Chuck Bohling

I'm running 2003. outllib ver ==11.0.6359.0

How big did RecurrenceState get? Over 8K? BTW, outlook 2002 has a similar
problem. But for it, the number was more like 240 exceptions before it ran
into problems. I'll run my test on 2002 again.
 
S

Stephen Griffin [MSFT]

If this is something you need fixed, you should consider opening a case so
we can request a hotfix.
 
C

Chuck Bohling

Yes, I'd like a fix. How do a go about opening a case? Turn's out outlook
2000 has the same problem. Seems like a MAPI_E_NOT_ENOUGH_MEMORY GetProps
problem.

Thanks
chuck
 
S

Stephen Griffin [MSFT]

Go up to http://support.microsoft.com/ and look at Assisted Support.

Outlook 2000 is no longer eligible for hotfix support, so you'll have to
live with the problem there. But we may be able to do something for XP or
2003.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top