REPOST: NJAWIN and getting a handle to Internet Explorer Popup Windows
843829Jul 16 2004 — edited Jul 19 2004I am using njawin to generate mshtml and shdocvw in order to control Internet
Explorer. I can get IE to come up and I can click links, set inputs, etc. When I click a link that pops up a new window the correct listener gets called but the reference to the new window is null.
Njawin generated Java for new window event:
public void NewWindow2(Object o, ObjectRef objectRef, ObjectRef objectRef1) throws COMException
MSHTML interface:
void NewWindow2(
IDispatch **&ppDisp,
VARIANT_BOOL *&Cancel
);
When the NewWindow2 java event is called, a reference to the original parent IWebBrowser2 is passed in the first parameter "Object o". And it looks like the new popup IWebBrowser2 should be passed in the second parameter "ObjectRef objectRef", but unfortunately it's getRef method returns null. The third parameter returns boolean which is correct according to the mshtml interface definition.
Does the code njawin generate not support these types of events properly? What can I do to make it work?
Thanks,
Brian