I'm trying to use the Skype4COM library in a Qt application. Now with dumpcpp I've created the h and cpp file.
I can collect User in my friends list and make a call but I don't know how I could receive events from Skype itself.
Watching the generated header file I found this:
// skipping event interface _ISkypeEvents
and is probably not a good sign. Does anyone know how I could get the (Skype) events working? If I do it in C# it is fairly easiliy but I want it in Qt.
Further more when using my (basic) application I get a segmentation fault when exiting my app. Am I missing something do destroy the ActiveX component?
delete m_Skype;
delete m_Skype;
To copy to clipboard, switch view to plain text mode
doesn't get rid of the segmentation fault.
Some code:
header:
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QAxObject>
#include "skype4comlib.h"
using namespace SKYPE4COMLib;
namespace Ui {
class MainWindow;
}
{
Q_OBJECT
public:
explicit MainWindow
(QWidget *parent
= 0);
~MainWindow();
private:
Ui::MainWindow* m_UI;
Skype* m_Skype;
};
#endif // MAINWINDOW_H
#ifndef MAINWINDOW_H
#define MAINWINDOW_H
#include <QMainWindow>
#include <QAxObject>
#include "skype4comlib.h"
using namespace SKYPE4COMLib;
namespace Ui {
class MainWindow;
}
class MainWindow : public QMainWindow
{
Q_OBJECT
public:
explicit MainWindow(QWidget *parent = 0);
~MainWindow();
private:
Ui::MainWindow* m_UI;
Skype* m_Skype;
};
#endif // MAINWINDOW_H
To copy to clipboard, switch view to plain text mode
the cpp:
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>
MainWindow
::MainWindow(QWidget *parent
) : m_UI(new Ui::MainWindow)
{
m_UI->setupUi(this);
m_Skype = new Skype();
m_Skype->Attach(6, true);
//m_Skype->SetSilentMode(true);
IUserCollection* friends = m_Skype->Friends();
for (int i = 1; i <= friends->Count(); i++)
{
IUser* user = friends->Item(i);
qDebug() << i << ":" << user->FullName();
}
}
MainWindow::~MainWindow()
{
delete m_UI;
}
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include <QDebug>
MainWindow::MainWindow(QWidget *parent) :
QMainWindow(parent),
m_UI(new Ui::MainWindow)
{
m_UI->setupUi(this);
m_Skype = new Skype();
m_Skype->Attach(6, true);
//m_Skype->SetSilentMode(true);
IUserCollection* friends = m_Skype->Friends();
for (int i = 1; i <= friends->Count(); i++)
{
IUser* user = friends->Item(i);
qDebug() << i << ":" << user->FullName();
}
}
MainWindow::~MainWindow()
{
delete m_UI;
}
To copy to clipboard, switch view to plain text mode
Bookmarks