IDispatchEx::InvokeEx (for javascript) - second time raises DISP_E_MEMBERNOTFOUND error
From: Santino (sankumar_nt_at_yahoo.com)
Date: 11/25/04
- Next message: elisabete: "Re: After Navigate() webbrowser properties are invalid"
- Previous message: Josh Mclaren: "Re: Igor, pAPP toolkit questions"
- Messages sorted by: [ date ] [ thread ]
Date: 24 Nov 2004 22:48:26 -0800
Hi,
I'm hosting a WebBrowser control in an ATL application.
I call IDispatchEx::InvokeEx to execute a javascript function
in the hosted page inside the browser control.
The function executes fine the first time, but the second
time and onwards it returns DISP_E_MEMBERNOTFOUND.
I can't figure out why this error is getting generated.
Will appreciate if you can pass me some ideas on how to
debug the cause for this issue?
Here is the code I use to execute javascript function.
void CIEScriptRunner::ExecuteJScript( BSTR bstrName,
DISPPARAMS *pDispParams,
CComVariant *pRetVal )
{
CComPtr<IDispatch> spScript;
CComPtr<IDispatchEx> spScriptEx;
DISPID dispid;
HRESULT hr;
VariantClear(pRetVal);
//Get the script fromt he document and then get the
//IDispatchEx interface
m_spDocument->get_Script((LPDISPATCH *) &spScript);
spScriptEx = spScript;
OLECHAR FAR* szMember = bstrName;
hr = spScriptEx->GetIDsOfNames(IID_NULL, &szMember, 1,
LOCALE_USER_DEFAULT,
&dispid) ;
if( dispid != -1 )
{
//This works fine the first time, but on subsequent
//calls, This is returning DISP_E_MEMBERNOTFOUND ???
hr = spScriptEx->InvokeEx(dispid, LOCALE_USER_DEFAULT,
DISPATCH_METHOD, pDispParams,
pRetVal, NULL, NULL);
}
}
Thanks in Advance
San
- Next message: elisabete: "Re: After Navigate() webbrowser properties are invalid"
- Previous message: Josh Mclaren: "Re: Igor, pAPP toolkit questions"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|
|