 +    HRESULT hr = m_htmlWin->execScript(CComBSTR(script.c_str()),
 +                                       CComBSTR("javascript"), &res);
 +    if (SUCCEEDED(hr)) {
-+        return this->getVariant(&res);
++        /* Throw away returned VARIANT, this method always returns VT_EMPTY.
++           http://msdn.microsoft.com/en-us/library/aa741364(VS.85).aspx */
++        return;
 +    } else {
 +        throw FB::script_error("Error executing JavaScript code");
 +    }
 +}
++
  FB::variant ActiveXBrowserHost::getVariant(const VARIANT *cVar)
  {
      CComVariant converted;
-diff -r b893f12eb85c src/ActiveXPlugin/ActiveXBrowserHost.h
---- a/src/ActiveXPlugin/ActiveXBrowserHost.h	Mon May 10 14:15:18 2010 -0600
-+++ b/src/ActiveXPlugin/ActiveXBrowserHost.h	Mon May 24 17:54:54 2010 +0300
+@@ -217,4 +236,4 @@
+         delete stream;
+         return 0;
+     }
+-}
+\ No newline at end of file
++}
+diff -r 5def419d742e src/ActiveXPlugin/ActiveXBrowserHost.h
+--- a/src/ActiveXPlugin/ActiveXBrowserHost.h	Fri Jun 25 15:32:34 2010 +0300
++++ b/src/ActiveXPlugin/ActiveXBrowserHost.h	Mon Jun 28 15:28:32 2010 +0300
 @@ -40,6 +40,7 @@
  public:
      FB::JSAPI_DOMDocument getDOMDocument();
      FB::JSAPI_DOMWindow getDOMWindow();
-+    FB::variant evaluateJavaScript(std::string script);
++    void evaluateJavaScript(const std::string &script);
  
  protected:
      HWND m_hWnd;

diff -r b893f12eb85c src/ActiveXPlugin/ActiveXBrowserHost.cpp
--- a/src/ActiveXPlugin/ActiveXBrowserHost.cpp	Mon May 10 14:15:18 2010 -0600
+++ b/src/ActiveXPlugin/ActiveXBrowserHost.cpp	Mon May 24 17:54:54 2010 +0300
@@ -66,6 +66,22 @@
     return FB::JSAPI_DOMWindow(retObj);
 }
 
+FB::variant ActiveXBrowserHost::evaluateJavaScript(std::string script)
+{
+    VARIANT res;
+

+
+    if (this->Evaluate(m_htmlWin->getNPObject(),
+                       &tmp.value.stringValue, &retVal)) {
+        this->ReleaseVariantValue(&retVal);
+        /* Throw away returned variant. NPN_Evaluate supports returning
+           stuff from JS, but ActiveX IHTMLWindow2::execScript does not */
+        return;
+    } else {
+        throw script_error("Error executing JavaScript code");
+    }
