I'm trying to do the same thing in my app, and have tried experimenting with
your example also. Both versions leave
"IE residue" on NT 4.0 which can be verfied using NT Task
Manager. Yep, IE goes away under the Apps tab, but
for an eye opener look in the Process tab and you will
see IEXPLORER and it will not go away unless you
kill it through task manager. If you happened to have IE
up already before looking at this, close it (and any other
instances), kill IEXPLORER in Task Manager, and run
your example again. I've talked to several folks more
knowledgable than me and they say there is nothing
incorrect with my code (nor yours since it is almost exactly
I know this to be correct for IE 4 with SP 2. Specifically
version 4.04.72.3612.1713. I've seen it on 2 different
machines. However I tried it on an earlier version of IE 4.0
(220.127.116.11.2106.8), and there was NO "residue". I'm updating
that machine with the new version to see if there is an
"undocumented feature" with later versions of IE.
>> On Sat, 13 Nov 1999 18:29:08 +0200, Alexander Arlievsky
>> Hi Alex. Long time no speak.
>> >I want to execute and control Internet explorer from my program.
>> >In the help for IWebBrowser2 :
>> >This interface enables applications to implement an instance of the
>> >WebBrowser control (ActiveX? control) or control an instance of the
>> >Microsoft? Internet Explorer application (OLE Automation).
>> >So can you tell me how can I create new instance of Microsoft? Internet
>> >Explorer and
>> >control it ?
>> You should be aware that there are two possibilities:
>> 1. To start IE as a standalone program, and pass commands to it.
>> IE supports a DDE interface (an issue which was discussed in
>> this group a while back).
>That's what I need, and now there is much more advanced way to do it -
>I mastered it myself:
>The following code will start explorer 4 or 5, and load MSoft web page.
> #include "mshtml.h"
> CString progid = "InternetExplorer.Application.1";
> BSTR ole_progid = progid.AllocSysString();
> CLSID clsid;
> IWebBrowser2 *pBrowser;
> CString url = "http://www.microsoft.com";
> BSTR ole_url = url.AllocSysString();
> COleVariant empty;
>> 2. To embed the WebBrowser control in your application (say,
>> as an ActiveX control in a dialog box).
>That's easy, MFC does it for you automatically.
>> Which are you referring to?
>> Ziv Caspi
> Alexander Arlievsky
> CS, Technion.
> Phone: 054-999948
> Visual C++ MFC developer,
> ER-Vision Ltd.
>"The most valuable tool for debugging are brains".