I don't really understand how it works, so could you clarify it for me.
I wrote this to trap the close event :
// OutlookEvents.h
BEGIN_SINK_MAP(COutlookEvents)
SINK_ENTRY_INFO(2,__uuidof(Outlook::ItemEvents),/*dispinterface*/,0xf004,OnItemClose,&OnItemCloseInfo)
END_SINK_MAP()
// handler
void __stdcall OnItemClose(IDispatch* Item);
// OutlookEvents.cpp
_ATL_FUNC_INFO OnItemCloseInfo={CC_STDCALL,VT_EMPTY,1,{VT_DISPATCH}};
void __stdcall COutlookEvents::OnItemClose(IDispatch* Item)
{ ......}
So when I click on close button, it launches this method, right ?
// generated by the class wrapper
void Close(BOOL * Cancel)
{
static BYTE parms[] = VTS_PBOOL ;
InvokeHelper(0xf004, DISPATCH_METHOD, VT_EMPTY, NULL, parms, Cancel);
}
Then It's my handler that catch this event.
if I add a parameter cancel like this :
void __stdcall COutlookEvents::OnItemClose(IDispatch* Item, BOOL *
Cancel )
{ ......}
Can I get back the value of Cancel( fired by void Close(BOOL * Cancel)
) in my handler ?
and if it's possible, isn't too late to set the value of Cancel to
true(or false) ?