Class initialisation and member variables

I can't seem to work this one out, no matter what I try. Specifically pertaining to using http://www.herqq.org/html/hupnp_v1/class_herqq_1_1_upnp_1_1_h_control_point.html#a9dfd540ef734d5fc7bff25deb39e240d

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#include <QtCore/QObject>
#include <HUpnpCore/HDiscoveryType>
#include <HUpnpCore/HControlPointConfiguration>

 class zoneSearch :
     public QObject
 {
 Q_OBJECT

 private:

     Herqq::Upnp::HControlPoint* m_controlPoint;
     Herqq::Upnp::HControlPointConfiguration* m_controlPointConfiguration;
     QTimer* m_timer;

 private slots:

 public:
    zoneSearch(QObject* parent = 0);
    Herqq::Upnp::HDiscoveryType m_deviceType;

 public Q_SLOTS:
 Q_INVOKABLE void startSearch();
 };


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
#include "zoneSearch.hpp"

#include <HUpnpCore/HControlPoint>
#include <QTimer>

zoneSearch::zoneSearch(QObject* parent) :
QObject(parent), m_controlPoint(NULL)
, m_controlPointConfiguration(new Herqq::Upnp::HControlPointConfiguration)
, m_timer(new QTimer(this))
{
}

void zoneSearch::startSearch() {

	m_controlPointConfiguration->setAutoDiscovery(false);

	m_controlPoint = new Herqq::Upnp::HControlPoint(m_controlPointConfiguration, QObject::parent());


I cannot for the life of me work out how to initialise the HControlPoint class with the configuration set from the HControlPointConfiguration class. Not even sure where to start going about this!

Any help would be great!

Error is: error: no matching function for call to 'Herqq::Upnp::HControlPoint::HControlPoint(Herqq::Upnp::HControlPointConfiguration*&, QObject*)'
What do the available contructors from HControlPoint look like? I have a feeling that you're not matching any of them when you create the new object.
From the link you posted, the HControlPoint constructor you're attempting to use takes a reference as it's first parameter. So, add a * before m_controlPointConfiguration on line 17. Also, read the documentation. =P
Indeed I missed the &. Thanks!
Topic archived. No new replies allowed.