I am working on a multi-threaded WTL-based application that opens multiple browser windows, each with its own embedded IWebBrowser2 instance for the browsing, and each in a separate UI thread.
In response to NewWindow3, I open a new browser-window, and return the new window's IWebBrowser2->get_Application()
which returns an IDispatchPtr
.
While the popup does open the desired site, the session in the original window, from which this popup was opened, EXPIRES - any further navigation in that original window takes be back to the login page!
Some points that I thought may be important for anyone to help me -
- This happens ONLY when the
NewWindow3
is fired, with a non-emptybstrUrlContext
(the 3rd parameter containing the originating URL) - As part of the NewWindow3 processing, the following done -
- Creation of the new IWebBrowser2-embedding window,
Create()
'ed withzWindowName
set to the value of thebstrUrlContext
parameter - The returned
IDispatch
pointer is retrieved fromIWebBrowser2->get_Application()
- Creation of the new IWebBrowser2-embedding window,