Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-42289

QAxScript and QAxObject doesn't allow to call method if the property with same name exists.

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 5.5.0
    • 5.3.1
    • ActiveX Support
    • 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".

      Attachments

        1. qtbug42289.zip
          2 kB
        2. qtbug42289_suggested.diff
          0.5 kB
        3. propertyget.patch.txt
          2 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            kleint Friedemann Kleint
            sryabinin Sergey Ryabinin
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes