MailItem:OnWrite event

  • Thread starter Thread starter Julieta Prandi
  • Start date Start date
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 -)
 
The problem was stupid!
I had to use: pDispParams->rgvarg[0].pboolVal instead of boolVal
 
Back
Top