I revised some code to iterate a collection in reverse, because I found it
was skipping entries and thus not purging all the right entries.  Iterating
in reverse works fine.  However, when I am running the DLL (Outlook addin)
in debug mode, I get a ATLASSERT:

                // Get the last item from the list
                // pOldItems->GetFirst( &pdisp );
                pOldItems->GetLast( &pdisp );
                while (pdisp != NULL)
                {
                        lItem++;
                        iPercent = CalculatePercent((int)lItem,
(int)lNumItems);
                        if (iPercent >= iLastPercent + 5 || iPercent == 100)
                        {
                                iLastPercent = iPercent;
                                SetProgressPos(IDS_TPL_PURGE_PROGRESS,
iPercent);
                        }
                        
                        CComQIPtr<Outlook::_AppointmentItem> pAppt = pdisp;
                        // Get category for this item
                        pAppt->get_Categories(&bstrCat);

                        // Can we delete it?
                        if (bstrCat == L"SoundRota")
                        {
                                pAppt->Delete();
                                lCount++;
                        }
                
                        // AJT v1.02 BUG Fix (see above)

                        // Get the previous item in the list
                        // hr = pOldItems->GetNext( &pdisp );
                        hr = pOldItems->GetPrevious( &pdisp );

--> The above line is the offender.  I can click ignore, and it will
continue.  It will ATLASSERT for each iteration.  Although it will purge all
the correct entries.
                }

Does anyone understand what I have to do to supress this ATLASSERT?

Andrew Truckle
CAD Manager
Atkins Survey and Mapping
Avon Way, Langley Park, Chippenham, Wiltshire. SN15 1GG
Telephone:     01249 455032
Switchboard:  01249 455000
Fax:             01249 455045
E-Mail: [EMAIL PROTECTED]
www.atkinsglobal.com <www.atkinsglobal.com> 



This email and any attached files are confidential and copyright protected. If 
you are not the addressee, any dissemination of this communication is strictly 
prohibited. Unless otherwise expressly agreed in writing, nothing stated in 
this communication shall be legally binding.

_______________________________________________
msvc mailing list
[email protected]
See http://beginthread.com/mailman/listinfo/msvc_beginthread.com for 
subscription changes, and list archive.

Reply via email to