[C++] how to use Close Event with void Close( BOOL * Cancel)

C

cyan21

hi,

I made a program that can catch events but now I'd like to prevent the
confirming box to be displayed when you close a window where you did
modifications inside( for e.g, a mail or an appointment).

I used a class wrapper to find codes which represent events in order to
use them in a sink map
for the close event, I did this:
BEGIN_SINK_MAP(COutlookEvents)
SINK_ENTRY_INFO(2,__uuidof(Outlook::ItemEvents),/*dispinterface*/,0xf004,OnItemClose,&OnItemCloseInfo)

END_SINK_MAP()

where 0xf004 is the code I found thanks to the class wrapper.


In the "CtemEvents.h" ( generated by the class wrapper), I found that
method :
void Close(BOOL * Cancel)
{
static BYTE parms[] = VTS_PBOOL ;
InvokeHelper(0xf004, DISPATCH_METHOD, VT_EMPTY, NULL, parms, Cancel);
}

If I put to false *Cancel, I think I can prevent the display of the
confirming box. However I don't know how to set Cancel to false....

Did someone ever try to do this ?
I hope someone could help me to solve this problem.

thanks in advance.

Yann
 

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