Link to home
Start Free TrialLog in
Avatar of Michal080800
Michal080800

asked on

HOW do i open an IE instance in the same process as my application's webbrowser process

I have a webbrowser control in my application. The links in the page that is displayed in the webbrowser, which should be opened in new windows, do not open properly. (i'e, window.open(...)).
The problem is probably related to cookies. The cookie of the webbrowser is not shared with the newly opened instance of ie. (Not in the same process).

When i catch the OnNewWindow2 event of the webbrowser, and set the *ppDisp to another webbrowser in my application, it does open correctly. (The new webbrowser control is opened in the same process as the client who called it).

I'd like to be able to open a link in an IE window which is a part of my application.

I tried using the following code:
LPVOID * m_pIE;
HRESULT hr = CoCreateInstance(CLSID_InternetExplorer,
                               NULL,
                               CLSCTX_INPROC_SERVER,
                               IID_IWebBrowser2,
                               (void**)&m_pIE);
if (hr == S_OK)
     *ppDisp = (IDispatch*)m_pIE;

But since the InternetExplorer object is of type .EXE it is opened out-of-process.

If anyone has other ideas. Please share.
Or, if anyone knows where i can find code of IE browser application, so that i can add it to my code. Also helpful.
ASKER CERTIFIED SOLUTION
Avatar of jkr
jkr
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
I'd say the Q is answered.