Hi,

I'm trying to call a VBScript from within Qt and set up a small test application:

Qt Code:
  1. #include <QAxScriptManager>
  2. #include <QDebug>
  3.  
  4. int main(int argc, char *argv[])
  5. {
  6. QAxScriptManager m_manager;
  7. QAxScript *m_helloWorld = m_manager.load("C:\\test.vbs", "HelloWorld");
  8. if (m_helloWorld)
  9. m_helloWorld->call("helloWorld");
  10. else
  11. qDebug() << "didn't load";
  12. }
To copy to clipboard, switch view to plain text mode 

The VBScript is at the right place on C:\test.vbs and looks like this:

Qt Code:
  1. Function helloWorld()
  2. msgbox("Hello World")
  3. End Function
To copy to clipboard, switch view to plain text mode 

Now when I compile and run this I don't get a QAxScript back from the QAxScriptManager. Stepping through the code I learned that the file is read and a QAxScript object created, but in the load function on it its isValid() function returns false because the internal member 'engine' is not set and therefore later the object is discarded and a NULL pointer returned. But I couldn't find where 'engine' would ever be set.

Can you please help me understand what I am doing wrong?
Or give me some example code?

Cheers
Jan

Edited: typo