Re: Why does this execScript code work



Angus <nospam@xxxxxxxxx> wrote:
CComBSTR type = L"javascript";
CComBSTR bstrScript = "myfunction";
CComVariant vRet;
hr=spWin2->execScript(bstrScript, type, &vRet);

When the spWin2->execScript function returns, hr is 0 and vRet is
VT_EMPTY (there is no return value from javascript function. But it
doesn't seem to work in that the javascript function doesn't seem to
be run. What am I doing wrong?

Surely the piece of script you want to execute is "myfunction()", not
just "myfunction".
--
With best wishes,
Igor Tandetnik

With sufficient thrust, pigs fly just fine. However, this is not
necessarily a good idea. It is hard to be sure where they are going to
land, and it could be dangerous sitting under them as they fly
overhead. -- RFC 1925


.



Relevant Pages

  • Re: return value from execScript
    ... Angus wrote: ... empty. ... That doesn't sound very good! ... A JavaScript function is a method on global script object, ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)
  • Re: Can I call a Javascript function using a BHO
    ... javascript function. ... With sufficient thrust, pigs fly just fine. ... overhead. ... -- RFC 1925 ...
    (microsoft.public.inetsdk.programming.webbrowser_ctl)