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?