Attempted to read or write protected memory

  • Thread starter Thread starter sd
  • Start date Start date
S

sd

hello

I've AX ctrl (vb6) placed on a form region adjoined to Message
form.This ctrl raises an event after 2 seconds each (say myevent)
which is handled in VSTO addin
mailWrapperclass.I need to save mailitem in that event in order to get
the recipients correctly.But I get exception " Attempted to read or
write protected memory This is
often an indication that other memory is corrupt." for Item.save
statement in myevent. This exception occurs only when I forward a
message,copy some image & paste it in body of forwarded
message,myevent gets triggered,when Item.Save encountered ,exception
is thrown & outlook crashes.The exception doesn't occur for new
message.I tried compiler optimization options suggested for same
error but invain.
Basically I need the recipients correctly so when user
changes,adds,removes recipient I can perform some action(say setting
combo value in AX ctrl).For that I'm raising the
event after 2 seconds each ,saving the item to get the recipients
properly.Is there any way to resolve this error or detect when
recipients are changed.

Thanks
 
Back
Top