The message is modified, when I open attachment table

Sep 1, 2010 at 5:15 PM

I am in the process of developing an application that uses ICS. MFCMAPI I use to explore some of MAPI properties.
When I open Display Attachment Table, by right mouse button affixed to a message and close it, I get a message inside my application that this e-mail has been modified and require synchronization. This never happens if I open this e-mail with Outlook.

I have not modified any properties of this message, in any way. I only open attachment table thru MFCMAPI.


Sep 15, 2010 at 3:30 PM

I'm not aware of any changes MFCMAPI would make to the message that you don't ask for. I'm guessing that the act of opening the attachment table forced some synchronization under the covers, which in turn modified the message.

Sep 15, 2010 at 4:41 PM

I understand ... I just wonder why this never happens when I open a message with Outlook, through my code, or by OutlookSpy ... Anyway, I'll seek another solution ...

Sep 15, 2010 at 5:22 PM

Okay... I just debug your application.

I think that the problem is here (file AttachmentsDlg.cpp):

if (m_lpAttach) m_lpAttach->Release();
if (m_lpMessage && m_bSaveMessageAtClose)
EC_H(m_lpMessage->SaveChanges(KEEP_OPEN_READWRITE));  // !!!! Why ???? I just want to lists the attachements
if (m_lpMessage) m_lpMessage->Release();

Sep 15, 2010 at 6:00 PM

Ok - I see how this happens. The short answer is it is incredibly difficult to determine if the user has made changes that need saving, and if I don't save by default, I get bug reports that none of the changes the user made got committed. I'll see if I can be smarter about not saving when nothing has changed.

Sep 15, 2010 at 6:30 PM

I understand that. I just observe. I know from my practice that is very "expensive" to monitor every user action.
I'll ignore that modification of the message in the synchronization process, assuming that end users will not work with MFCMAPI :)
Wishing you a nice day.