Method Signature Question

  • Thread starter Thread starter Arsen V.
  • Start date Start date
A

Arsen V.

Hi,

Which one is the proper signature for NewWindow2 event?

1) STDMETHOD (OnNewWindow2) (IDispatch **&ppDisp, VARIANT_BOOL *Cancel);

or

2) STDMETHOD (OnNewWindow2) (IDispatch **&ppDisp, VARIANT_BOOL *&Cancel);

I am using the first one, and set the Cancel flag to TRUE as follows:

STDMETHODIMP (OnNewWindow2) (IDispatch **&ppDisp, VARIANT_BOOL *Cancel)
{
.....
*Cancel = VARIANT_TRUE;
....
}
This appears to work.

However, when I try to use the second signature (the one with *&Cancel) and
set the Cancel to TRUE like this *Cancel = VARIANT_TRUE, my IE crashes. What
am I doing wrong *AND* how to fix it?

Thanks in advance,
Arsen
 
Arsen V. said:
Which one is the proper signature for NewWindow2 event?

1) STDMETHOD (OnNewWindow2) (IDispatch **&ppDisp, VARIANT_BOOL
*Cancel);

or

2) STDMETHOD (OnNewWindow2) (IDispatch **&ppDisp, VARIANT_BOOL
*&Cancel);

Neither. That would be

STDMETHOD (OnNewWindow2) (IDispatch **ppDisp, VARIANT_BOOL *Cancel);

There is no such thing as a reference in COM.
--
With best wishes,
Igor Tandetnik

"For every complex problem, there is a solution that is simple, neat,
and wrong." H.L. Mencken
 

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

Back
Top