Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Update: Forum Guidelines & Code of Conduct

    Controlling Windows Media Player 12 through QAxWidget

    General and Desktop
    1
    2
    1283
    Loading More Posts
    • 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.
    • M
      mihaig last edited by mihaig

      I am trying to control WMP12 through ActiveX with the following code:

       QAxWidget *wmp;
       wmp = new QAxWidget(this);
       wmp->setControl("{6BF52A52-394A-11D3-B153-00C04F79FAA6}");
       wmp->setProperty("URL", "C:/Users/qxf3567/Downloads/demoMedia/movie/00522M002M_VHS.MOV");
       qDebug("Version Info: %s", qPrintable(wmp->property("versionInfo").toString()));
       
       QAxObject *subObj = wmp->querySubObject("currentMedia()");
       qDebug("Duration %f", subObj->property("duration").toDouble());
      

      I get true as a result when setting the URL property and the version gets displayed correctly.

      However, the duration is always 0. I have double checked that the movie exists on my machine. What could be the problem?

      The output is:
      Version Info: 12.0.7601.18741
      Duration 0.000000

      Cheers,
      Mihai

      1 Reply Last reply Reply Quote 0
      • M
        mihaig last edited by

        It seems that the following call:
        qDebug("State: %s", qPrintable(wmp->property("playState").toString()));

        says the state is 9 which according to [1] means transitioning.

        How can one check if the player is ready ? Can anybody provide a code example please?

        [1] https://msdn.microsoft.com/en-us/library/windows/desktop/dd564085(v=vs.85).aspx

        1 Reply Last reply Reply Quote 0
        • First post
          Last post