Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Cannot "Navigate" With IWebBrowserApp & IWebBrowser2 (error 0x800706f4) !!!!

203 views
Skip to first unread message

Murali Krishna Devarakonda

unread,
Aug 10, 1998, 3:00:00 AM8/10/98
to
You shouldn't pass NULL to Navigate/Navigate2.
It's documented in one of the KB Articles (I'll post it here if can find it
again).

Instead of
hr = m_pWebBrowser->Navigate((BSTR)t_pURL, NULL, NULL, NULL, NULL);

the suggested workaround IN MFC is:

COleVariant noArg;
hr = m_pWebBrowser->Navigate((BSTR)t_pURL, &noArg, &noArg, &noArg,
&noArg);

I'm sure you can figure out the Non-MFC equivalent.

Regards,

Murali Krishna Devarakonda

Murali Krishna Devarakonda

unread,
Aug 10, 1998, 3:00:00 AM8/10/98
to
See Knowledge Base Article Q182490: BUG: Navigate(2) Causes Access Violation
in Shdocvw.dll
at: http://support.microsoft.com/support/kb/articles/q182/4/90.asp

Murali Krishna Devarakonda


Pierre

unread,
Aug 11, 1998, 3:00:00 AM8/11/98
to
Hi there,

I'm using the WebBrowser control since the first realease of the
Internet Explorer supporting it (3.01 I think). It works real fine inside my
C++ application's container. I can almost do everything.

Recently I wanted to pilot the Internet Explorer with direct automation
control : Open up the Internet Explorer Application and go to a specific
URL. Unfortunatly I'm having a probleme using the Navigate and the Navigate2
methods. Almost everthing I need works fine except these two functions. Each
time I want to navigate to an URL I have this 0x800706f4 undocumented.

Why is this happening to me ?
does any body have any idea how could I resolve this probleme ?

PS : I'm programming in pure C++, No MFC, no ATL, nothing but independant
pure C++ code with VC5.
This is my way of using the Navigate and Navigate2 functions that works real
fine inside a control container and not at all in automation:

BOOL CWPWebBrowser::Navigate(LPCTSTR p_pURL)
{
HRESULT hr;
BSTR t_pURL;
BOOL bRet = FALSE;
OLECHAR t_UnicodeURL[2*256];

if ((m_pWebBrowser == NULL) || (p_pURL == NULL)) return FALSE;

ConvertToUnicode((char FAR*)p_pURL, t_UnicodeURL);
if ((t_pURL = SysAllocString(t_UnicodeURL)) != NULL) {


hr = m_pWebBrowser->Navigate((BSTR)t_pURL, NULL, NULL, NULL, NULL);

bRet = (hr == S_OK);
SysFreeString(t_pURL);
}
return bRet;
}

BOOL CWPWebBrowser::Navigate2(LPCTSTR p_pURL)
{
HRESULT hr;
BOOL bRet = FALSE;
OLECHAR t_UnicodeURL[2*256];
VARIANT *vt_URL = new VARIANT;

VariantInit(vt_URL);

if (m_pWebBrowser == NULL) return FALSE;
if ((dwVersion != IE_VER_4) && (dwVersion != IE_VER_4_95)) return FALSE;
ConvertToUnicode((char FAR*)p_pURL, t_UnicodeURL);
if ((vt_URL->bstrVal = SysAllocString(t_UnicodeURL)) != NULL) {
vt_URL->vt = VT_BSTR;
hr = ((IWebBrowser2*)m_pWebBrowser)->Navigate2(vt_URL, NULL, NULL, NULL,
NULL);
bRet = (hr == S_OK);
SysFreeString(vt_URL->bstrVal);
}
delete vt_URL;
return bRet;
}


I do QueryInterface CLSID_InternetExplorer either for IID_IWebBrowserApp in
IE 3.01 or IID_IWebBrowser2 for IE4 and over.


Please Where is My Error ?


A+
Pierre Chehwan ;Ţ
pche...@ixo.fr

Pierre Chehwan

unread,
Aug 11, 1998, 3:00:00 AM8/11/98
to
Thanks Murali,

Although I don't have any access violation, putting empty VARIANT instead of
NULL in the optional parameters resolves my problem. Now I can navigate
without any problem.

Thank again
Pierre

Murali Krishna Devarakonda wrote in message ...

0 new messages