Details
-
Bug
-
Resolution: Done
-
P3: Somewhat important
-
5.3.1
-
None
-
Windows 7
Microsoft JScript v5.8.9600.164128
-
46c51861822c4ee8f0e7d7f5ecc23d1595cf5c1d (qtactiveqt/dev, 7.11.2014, 5.5)
Description
QAxScriptManager scriptManager; QAxScript* script = scriptManager.load("function Init(){ return 'test';}", "Test", "JScript"); QVariant result = script->call("Init()"); Q_ENSURE(result.toString() == "test");
The problem is that QT invoke IDispatch method of jscript with disptype = DISPATCH_METHOD | DISPATCH_PROPERTYGET instead of DISPATCH_METHOD (see method QAxBase::dynamicCallHelper). Microsoft jscript realy has property 'Init' as a IDispatch reference to script functions and the function Init. jscripts functions with parameters are invoked properly.
To workaround I have to get IDispatch to jscript Function and invoke it method "call".