|
#include <atlbase.h>
#include <MsHTML.h>
...
OleInitialize (NULL);
{
CComPtr <IWebBrowser2> spWebBrowser;
spWebBrowser.CoCreateInstance (CLSID_InternetExplorer);
// Add some properties here, such as no toolbar, no address bar or something
// Note that some browser shells will take over this request, such as setting the default Maxthon
spWebBrowser-> put_Visible (VARIANT_TRUE);
CComVariant url (TEXT ("http://www.microsoft.com/"));
CComVariant vtEmpty;
spWebBrowser-> Navigate2 (&url,&vtEmpty,&vtEmpty,&vtEmpty,&vtEmpty);
}
OleUninitialize (); |
|