Yes i've tried using a dependancy walker, everything needed was there.
(btw. the port is here: http://winkde.org/pub/kde/ports/win3...ory/win32libs/ )
Maybe someone who used DBus under windows can tell me what are the must-needed files to run dbus-daemon from command prompt from a particular location? eg. E:/Deploy/PR1
I would appreciate it very much.
I have another DBus related question. Please advise whether i should make a new thread about this.
I intend to use a signal like the following with DBus:
void start
(int id,
const QString &name, Stuff stuff
);
void start(int id, const QString &name, Stuff stuff);
To copy to clipboard, switch view to plain text mode
The structure Stuff:
typedef struct
{
MY_TYPE type;
} Stuff;
typedef struct
{
QString a;
QString b;
MY_TYPE type;
} Stuff;
To copy to clipboard, switch view to plain text mode
I used dbusxml2cpp to achieve my needed interface and adaptor files. My problem is, that the slot connected to this signal does not get called. The problem must lie somewhere in the marshalling of my custom type, because the signal-slot mechanism through DBus works perfectly with Qt types.
I declared my struct and enum with Q_DECLARE_METATYPE. I also registered them on the DBus:
qDBusRegisterMetaType<Stuff>();
qDBusRegisterMetaType<MY_TYPE>();
qDBusRegisterMetaType<Stuff>();
qDBusRegisterMetaType<MY_TYPE>();
To copy to clipboard, switch view to plain text mode
I've also overridden the QDBusArgument << and >> operators, thusly:
{
arg.beginStructure();
arg << stuff.a << stuff.b << stuff.type;
arg.endStructure();
return arg;
}
{
arg.beginStructure();
arg << static_cast<int>(ct);
arg.endStructure();
return arg;
}
QDBusArgument &operator << (QDBusArgument &arg, const Stuff& stuff)
{
arg.beginStructure();
arg << stuff.a << stuff.b << stuff.type;
arg.endStructure();
return arg;
}
QDBusArgument &operator << (QDBusArgument &arg, const MY_TYPE& ct)
{
arg.beginStructure();
arg << static_cast<int>(ct);
arg.endStructure();
return arg;
}
To copy to clipboard, switch view to plain text mode
Similarly, the other way around.
I am trying to emit a signal the following way:
msg
= QDBusMessage::createSignal("/Pr1",
"com.trolltech.pr1",
"start");
msg << m_ID;
msg << m_name;
msg <<
QVariant::fromValue<Stuff>
(m_stuff
);
QDBusMessage msg;
msg = QDBusMessage::createSignal("/Pr1", "com.trolltech.pr1", "start");
msg << m_ID;
msg << m_name;
msg << QVariant::fromValue<Stuff>(m_stuff);
QDBusConnection::sessionBus().send(msg);
To copy to clipboard, switch view to plain text mode
The slot in my other process doesn't get called.
What did i miss/done wrong?
Thanks in advance, there isn't an abundance of info or examples for using custom types with DBus, so i would appreciate any assistance.
Bookmarks