Important: Please read the Qt Code of Conduct -

QAxObject with FileSystemObject

  • Hi all,
    I would like to use this MSDN example in Qt:

    var fs = CreateObject("Scripting.FileSystemObject");
    var a = fs.CreateTextFile("c:\testfile.txt", True)
    a.WriteLine("This is a test.");

    What i'm trying to do is:
    fso = new QAxObject("Scripting.FileSystemObject", 0);
    fso->dynamicCall("CreateTextFile(const QVariant&)", QVariant("c:\temp\test1.txt"));
    fso_file = fso->querySubObject("TextStream");

    The file c:\temp\test1.xls is created, but i would like to write to it. I have a runtime debug message saying:

    "QAxBase::dynamicCallHelper: TextStream: No such property in {0d43fe01-f093-11cf-8940-00a0c9054228} [FileSystem Object]
    Candidates are:"

    According to the link below, CreateTextFile returns a TextStream object... So why can't i query it?

    No luck googling, seems like nobody tried this before.

Log in to reply