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. Controlling Windows Media Player 12 through QAxWidget
Forum Updated to NodeBB v4.3 + New Features

Controlling Windows Media Player 12 through QAxWidget

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.5k Views 1 Watching
  • 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 Offline
    M Offline
    mihaig
    wrote on last edited by mihaig
    #1

    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
    0
    • M Offline
      M Offline
      mihaig
      wrote on last edited by
      #2

      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
      0

      • Login

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