eliminated nasty warning message

svn path=/trunk/; revision=8138
This commit is contained in:
Martin Fuchs 2004-02-10 21:22:55 +00:00
parent 30462af124
commit 9f5e152d22
4 changed files with 32 additions and 17 deletions

View file

@ -623,8 +623,11 @@ int MainFrame::Command(int id, int code)
break;}
case ID_WEB_WINDOW:
#ifdef _DEBUG
create_webchildwindow(WebChildWndInfo(_hmdiclient, TEXT("http://localhost")));
#else
create_webchildwindow(WebChildWndInfo(_hmdiclient, TEXT("http://www.reactos.com")));
//create_webchildwindow(_hmdiclient, WebChildWndInfo(TEXT("http://localhost")));
#endif
break;
///@todo There are even more menu items!

View file

@ -101,12 +101,16 @@ void BStr::assign(const VARIANT& var)
}
BrowserNavigator::BrowserNavigator(IWebBrowser* browser)
: _browser(browser),
_browser_initialized(false)
BrowserNavigator::BrowserNavigator()
: _browser_initialized(false)
{
}
void BrowserNavigator::attach(IWebBrowser* browser)
{
_browser = browser;
}
void BrowserNavigator::goto_url(LPCTSTR url)
{
if (_browser_initialized)
@ -198,18 +202,17 @@ WebChildWindow::WebChildWindow(HWND hwnd, const WebChildWndInfo& info)
hr = create_control(hwnd, CLSID_MozillaBrowser, IID_IWebBrowser2);
if (SUCCEEDED(hr)) {
_navigator.attach(_control);
HWND hwndFrame = GetParent(info._hmdiclient);
// handling events using DWebBrowserEvents2
_evt_handler = auto_ptr<DWebBrowserEvents2Handler>(new DWebBrowserEvents2Handler(_hwnd, hwndFrame, _control));
SIfacePtr<IWebBrowser2> browser(get_browser());
_evt_handler = auto_ptr<DWebBrowserEvents2Handler>(new DWebBrowserEvents2Handler(_hwnd, hwndFrame, _navigator));
#ifdef __MINGW32__ // MinGW is lacking vtMissing (as of 07.02.2004)
Variant vtMissing;
#endif
browser->Navigate(BStr(info._path), &vtMissing, &vtMissing, &vtMissing, &vtMissing);
get_browser()->Navigate(BStr(info._path), &vtMissing, &vtMissing, &vtMissing, &vtMissing);
//browser->Navigate2(&Variant(info._path), &vtMissing, &vtMissing, &vtMissing, &vtMissing);
}
}

View file

@ -569,12 +569,15 @@ struct DWebBrowserEvents2IF
// die nicht auf das Internet zugreift (z.B. addcom/./index.html) dargestellt werden kann.
struct ANSUNC BrowserNavigator
{
BrowserNavigator(IWebBrowser* browser);
BrowserNavigator();
void attach(IWebBrowser* browser);
void goto_url(LPCTSTR url);
void set_html_page(const String& html_txt);
void navigated(LPCTSTR url);
IWebBrowser* get_browser() {return _browser.get();}
protected:
SIfacePtr<IWebBrowser> _browser;
String _new_url;
@ -889,13 +892,13 @@ struct DWebBrowserEvents2Handler : public DWebBrowserEvents2Impl
{
typedef DWebBrowserEvents2Impl super;
DWebBrowserEvents2Handler(HWND hwnd, HWND hwndFrame, IWebBrowser* browser)
: _hwnd(hwnd),
DWebBrowserEvents2Handler(HWND hwnd, HWND hwndFrame, BrowserNavigator& navigator)
: DWebBrowserEvents2Impl(navigator),
_hwnd(hwnd),
_hwndFrame(hwndFrame),
_navigator(browser),
DWebBrowserEvents2Impl(_navigator),
_browser(browser, IID_IWebBrowser2),
_connector(browser, DIID_DWebBrowserEvents2, this)
_navigator(navigator),
_browser(navigator.get_browser(), IID_IWebBrowser2),
_connector(navigator.get_browser(), DIID_DWebBrowserEvents2, this)
{
}
@ -1058,7 +1061,7 @@ protected:
protected:
HWND _hwnd;
HWND _hwndFrame;
BrowserNavigator _navigator;
BrowserNavigator& _navigator;
SIfacePtr<IWebBrowser2> _browser;
EventConnector _connector;
};
@ -1087,6 +1090,7 @@ struct WebChildWindow : public IPCtrlWindow<ChildWindow, SIfacePtr<IWebBrowser2>
}
protected:
BrowserNavigator _navigator;
auto_ptr<DWebBrowserEvents2Handler> _evt_handler;
LRESULT WndProc(UINT message, WPARAM wparam, LPARAM lparam);

View file

@ -405,6 +405,11 @@ template<typename T> struct SIfacePtr
return _p->QueryInterface(riid, (LPVOID*)p);
}
T* get()
{
return _p;
}
void Free()
{
T* h = _p;