m_Skype = new Skype();
m_Skype->Attach(5, true);
connect(m_Skype,
SIGNAL(signal(QString,
int,
void*)),
SLOT(Sink
(QString,
int,
void*)));
connect(m_Skype,
SIGNAL(ContactsFocused
(QString)),
SLOT(ContactsFocused
(QString)));
connect(m_Skype, SIGNAL(CallStatus(ICall*,TCallStatus)), SLOT(CallStatus(ICall*,TCallStatus)));
void SkypeWrapper
::ContactsFocused(QString name
) {
qDebug() << "ContactsFocused:" << name; // <- Called!
}
void SkypeWrapper::CallStatus(ICall* pCall, TCallStatus Status)
{
qDebug() << "CallStatus(ICall):"; // <- Never called
}
void SkypeWrapper::Sink(const QString& name, int argc, void * argv)
{
qDebug() << "sink: name(" << name << ") argc(" << argc<< ")";
VARIANTARG* params = (VARIANTARG*)argv;
if (name.startsWith("CallStatus"))
{
//According to Qt the arguments are in reverse order
IDispatch* dis = params[argc-1].pdispVal;
ICall* call = (ICall*)dis;
dis.Answer(); // <- Segmentation fault
}
}
m_Skype = new Skype();
m_Skype->Attach(5, true);
connect(m_Skype, SIGNAL(signal(QString,int,void*)), SLOT(Sink(QString,int,void*)));
connect(m_Skype, SIGNAL(ContactsFocused(QString)), SLOT(ContactsFocused(QString)));
connect(m_Skype, SIGNAL(CallStatus(ICall*,TCallStatus)), SLOT(CallStatus(ICall*,TCallStatus)));
void SkypeWrapper::ContactsFocused(QString name)
{
qDebug() << "ContactsFocused:" << name; // <- Called!
}
void SkypeWrapper::CallStatus(ICall* pCall, TCallStatus Status)
{
qDebug() << "CallStatus(ICall):"; // <- Never called
}
void SkypeWrapper::Sink(const QString& name, int argc, void * argv)
{
qDebug() << "sink: name(" << name << ") argc(" << argc<< ")";
VARIANTARG* params = (VARIANTARG*)argv;
if (name.startsWith("CallStatus"))
{
//According to Qt the arguments are in reverse order
IDispatch* dis = params[argc-1].pdispVal;
ICall* call = (ICall*)dis;
dis.Answer(); // <- Segmentation fault
}
}
To copy to clipboard, switch view to plain text mode
Bookmarks