Attempted to read or write protected memory

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
 

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