MsHtmHstInterop SetUIHandler revert to default

  • Thread starter Thread starter wiseleyb
  • Start date Start date
W

wiseleyb

After doing a SetUIHandler how to I revert back to the default
behavior?

I'm using

ICustomDoc cDoc = (ICustomDoc)this.wb.Document;
cDoc.SetUIHandler((IDocHostUIHandler)this);

to allow JavaScript to call functions in C#. Once this is done many
things change in terms of behavior in the browser. I tried setting it
back to the default handler by trying

cDoc.SetUIHandler(null);

but this event still fires:

void IDocHostUIHandler.GetExternal(out object ppDispatch)

setting ppDispatch = null in this function didn't stop GetExternal
from over riding keyboard strokes (<enter>) either.

So - any ideas on how to revert back to the default handler?

-ben
 
wiseleyb said:
After doing a SetUIHandler how to I revert back to the default
behavior?

I'm using

ICustomDoc cDoc = (ICustomDoc)this.wb.Document;
cDoc.SetUIHandler((IDocHostUIHandler)this);

to allow JavaScript to call functions in C#. Once this is done many
things change in terms of behavior in the browser. I tried setting it
back to the default handler by trying

cDoc.SetUIHandler(null);

but this event still fires:

void IDocHostUIHandler.GetExternal(out object ppDispatch)

setting ppDispatch = null in this function didn't stop GetExternal
from over riding keyboard strokes (<enter>) either.

So - any ideas on how to revert back to the default handler?

Set ppDispatch to something != null, like:

ppDispatch = new Object();

You probably also have to renavigate/reload the document.

bye
Rob
 
Back
Top