MailItem:OnWrite event

J

Julieta Prandi

Hi guys,

I'm trying to cancel the write event of a mail item.
I connected the mail item to my object to get the events in the Invoke
function (I did this because I need to support old versions too and they
have different parameters).
In OL 2000 and higher I receive the OnWrite event with a parameter by ref
that should cancel the operation if it is true.
I'm doing this in the Invoke function:

if(pDispParams->rgvarg[0].vt == (VT_BOOL|VT_BYREF)) {
OnSaveButtonClicked(&pDispParams->rgvarg[0].boolVal);
return S_OK;
}

I verified that pDispParams->rgvarg[0].boolVal contains VARIANT_TRUE after
calling OnSaveButtonClicked function but the save operation doesn't cancel
as I want.

Does anyone know what could be happening?

Thanks,
(- Julieta -)
 
J

Julieta Prandi

The problem was stupid!
I had to use: pDispParams->rgvarg[0].pboolVal instead of boolVal
 

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