Results 1 to 5 of 5

Thread: ActiveX interface problem

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Oct 2009
    Location
    Hamburg - Germany
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question ActiveX interface problem

    Hello,

    i'm using qt 4.7.1 and MSVC++ 2008.

    My problem, i can't connect to any interfaces of the windows media player, by activeX.

    Small testprogramm

    mediaplayer_simple.pro
    Qt Code:
    1. TEMPLATE = app
    2. CONFIG += qaxcontainer
    3. HEADERS = playerwindow.h
    4. SOURCES = main.cpp \
    5. playerwindow.cpp
    To copy to clipboard, switch view to plain text mode 

    playerwindow.h
    Qt Code:
    1. #ifndef PLAYERWINDOW_H
    2. #define PLAYERWINDOW_H
    3.  
    4. #include <QWidget>
    5. class QAxWidget;
    6.  
    7. class PlayerWindow : public QWidget
    8. {
    9. public:
    10. PlayerWindow();
    11.  
    12. private:
    13. QAxWidget *wmp;
    14. };
    15.  
    16. #endif
    To copy to clipboard, switch view to plain text mode 

    playerwindow.cpp
    Qt Code:
    1. #include <QtGui>
    2. #include <QAxWidget>
    3. #include <QAxObject>
    4.  
    5. #include "playerwindow.h"
    6. #include <windows.h>
    7. #include <wmp.h>
    8.  
    9. PlayerWindow::PlayerWindow()
    10. {
    11. wmp = new QAxWidget(this);
    12. wmp->setControl("{6BF52A52-394A-11D3-B153-00C04F79FAA6}");
    13. wmp->setProperty("URL", "D:/clock.avi");
    14. qDebug("Version Info: %s", qPrintable(wmp->property("versionInfo").toString()));
    15.  
    16. IWMPMedia *media;
    17. wmp->queryInterface(QUuid(IID_IWMPMedia), (void **)&media);
    18. if (media)
    19. {
    20. double dur;
    21. media->get_duration(&dur);
    22. qDebug("Duration 2 %f", dur);
    23. media->Release();
    24. }
    25. else
    26. {
    27. qDebug("Failed");
    28. }
    29. }
    To copy to clipboard, switch view to plain text mode 

    main.cpp
    Qt Code:
    1. #include <QApplication>
    2. #include "playerwindow.h"
    3.  
    4. int main(int argc, char *argv[])
    5. {
    6. QApplication app(argc, argv);
    7. PlayerWindow playerWin;
    8. playerWin.show();
    9. return app.exec();
    10. }
    To copy to clipboard, switch view to plain text mode 


    Compiling failed, playerwindow.obj:: error: ... extern symbol "_IID_IWMPMedia" in Funktion ""public: __thiscall PlayerWindow::PlayerWindow(void)" (??0PlayerWindow@@QAE@XZ)".

    Original german compiler Message -->
    Verweis auf nicht aufgelöstes externes Symbol "_IID_IWMPMedia" in Funktion ""public: __thiscall PlayerWindow::PlayerWindow(void)" (??0PlayerWindow@@QAE@XZ)".


    Something is wanting by the compiler, but i don't know what.
    Anybody an idea?

  2. #2
    Join Date
    Jul 2009
    Posts
    74
    Thanks
    2
    Thanked 6 Times in 6 Posts

    Default Re: ActiveX interface problem

    wmp.h is has been generated with dumpcpp?

  3. #3
    Join Date
    Oct 2009
    Location
    Hamburg - Germany
    Posts
    8
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: ActiveX interface problem

    Hi javimoya,

    no, it's from folder of "Microsoft SDKs\Windows\v6.0A\Include ... the Windows SDK include also the windows media player sdk.
    I see, i forgot it at the project file ... testing with path in HEADERS to wmp.h fails.

Similar Threads

  1. Get the iDispatch interface of an ActiveX control
    By punkypogo in forum Qt Programming
    Replies: 1
    Last Post: 17th August 2010, 08:00
  2. Problem with design interface
    By tux-world in forum Newbie
    Replies: 5
    Last Post: 10th March 2010, 14:19
  3. ActiveX
    By franco.amato in forum Qt Programming
    Replies: 6
    Last Post: 29th December 2009, 17:06
  4. ActiveX problem with ie8
    By ftrastour in forum Qt Programming
    Replies: 0
    Last Post: 9th November 2009, 13:03
  5. How can i use ActiveX
    By mmg123 in forum Qt Tools
    Replies: 6
    Last Post: 3rd October 2006, 11:18

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.