Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. QAxObject calls seem to timeout, how to debug
Qt 6.11 is out! See what's new in the release blog

QAxObject calls seem to timeout, how to debug

Scheduled Pinned Locked Moved Solved General and Desktop
2 Posts 1 Posters 635 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    axeljaeger17
    wrote on last edited by
    #1

    Hello,
    I want to remote controll another application using QAxObject but I am struggling getting the most basic example to work:

    I created an application with just one button that is connected to this slot:

    void MainWindow::callWord()
    {
        QAxObject* word_app = new QAxObject("Word.Application", this);
        QAxObject* document_collection = word_app->querySubObject("Documents");
        document_collection->dynamicCall("Add()");
    }
    

    When executing the slots, the application hangs for several seconds, but nothing happens in Word. When calling basically the same code in powershell, I get a new document.

    When changing "Add()" to something else, I get at least an error message of "No such property in...". I am now out of ideas what to do next how to further debug the situation.

    This is a nailed down example, I tried remote controlling another application with basically the same sympthoms: I get error messages when trying to call non existent methods, but calls to methods that seem to be exist are not successfull.

    Does anyone has more ideas how to digg into this?

    I am runing Qt 5.9.1 using the MinGW Compiler on Windows 10, most recent version

    A 1 Reply Last reply
    0
    • A axeljaeger17

      Hello,
      I want to remote controll another application using QAxObject but I am struggling getting the most basic example to work:

      I created an application with just one button that is connected to this slot:

      void MainWindow::callWord()
      {
          QAxObject* word_app = new QAxObject("Word.Application", this);
          QAxObject* document_collection = word_app->querySubObject("Documents");
          document_collection->dynamicCall("Add()");
      }
      

      When executing the slots, the application hangs for several seconds, but nothing happens in Word. When calling basically the same code in powershell, I get a new document.

      When changing "Add()" to something else, I get at least an error message of "No such property in...". I am now out of ideas what to do next how to further debug the situation.

      This is a nailed down example, I tried remote controlling another application with basically the same sympthoms: I get error messages when trying to call non existent methods, but calls to methods that seem to be exist are not successfull.

      Does anyone has more ideas how to digg into this?

      I am runing Qt 5.9.1 using the MinGW Compiler on Windows 10, most recent version

      A Offline
      A Offline
      axeljaeger17
      wrote on last edited by
      #2

      I found it myself: The code was indeed working but the instances of word where hidden. After calling setProperty("Visible", true) on the word_app, the window finally becomes visible. I only found this after an update of office today. After the updater was complete and restored all open office applications, I had 20 instances of word running.

      1 Reply Last reply
      0

      • Login

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups
      • Search
      • Get Qt Extensions
      • Unsolved