Qt D-bus Error , How to use Qt D-Bus under windows ?
-
wrote on 9 Nov 2021, 10:19 last edited by
Hello everyone,
I'm trying to run a Qt d-bus example (chat) on Windows. It compiles fine but I still getting this error below.
Cannot connect to the D-Bus session bus.
Please check your system settings and try again.
QEventDispatcherWin32::wakeUp: Failed to post a message (Handle de fenĂȘtre non valide.)I installed D-Bus on Windows through a ready made installer found in Google archives
https://code.google.com/archive/p/dbus-windows-installer/downloads
unfortunately I still getting the same error,


maybe someone can give me idea ,how to use Qt D-bus on windows ?
Or how to run dbus-daemon under windows ?thank you very much for your help
-
wrote on 9 Nov 2021, 15:13 last edited by
For more information , After reviewed this answer :
https://stackoverflow.com/questions/34342061/specify-dbus-session-address-on-windows
i still can't set up it under my Machine, i obtain this error:

thank you in advance for your help -
wrote on 10 Nov 2021, 16:17 last edited by
-
wrote on 10 Nov 2021, 17:29 last edited by
@Alex42 Have you tried this windows dbus port from freedesktop.org?
Never tried it. Might be better than that archived dbus code you found on google. -
wrote on 10 Nov 2021, 18:39 last edited by
Is there a reason why you want to use D-Bus on Windows?
-
wrote on 10 Nov 2021, 20:25 last edited by
@mchinand I let you take a look at my question in another topic,here
https://forum.qt.io/topic/131878/how-to-use-signals-slots-to-make-inter-process-communication-in-qt -
@Alex42 Have you tried this windows dbus port from freedesktop.org?
Never tried it. Might be better than that archived dbus code you found on google. -
@idlefrog yes i tried it, but i don't found more explanation about to run dbus-daemon on windows
-
@Alex42 I strongly believe you'd have it done faster by setting up interprocess communication using TCP socket. But then again, it is Windows, so who knows.
wrote on 10 Nov 2021, 20:53 last edited byI agree with @artwaw. Check out the fortune example client and server.
-
I agree with @artwaw. Check out the fortune example client and server.
wrote on 12 Nov 2021, 11:16 last edited by@mchinand, As you see, the problem it's not in the TCP/IP ( local server / socket ,shared memory ,QProcess class, QT Network ) , the problem it's how to run d-bus daemon on the windows , ( or how to use Qt D-Bus under Windows )
-
@mchinand, As you see, the problem it's not in the TCP/IP ( local server / socket ,shared memory ,QProcess class, QT Network ) , the problem it's how to run d-bus daemon on the windows , ( or how to use Qt D-Bus under Windows )
@Alex42 said in Qt D-bus Error , How to use Qt D-Bus under windows ?:
the problem it's how to run d-bus daemon on the windows , ( or how to use Qt D-Bus under Windows )
This is outside of Qt. I suggest you also search on the Internet.
-
@Alex42 said in Qt D-bus Error , How to use Qt D-Bus under windows ?:
how to use Qt D-bus on windows ?
In your main.cpp, before any other Qt code, paste this:
int main(int argc, char *argv[]) { #ifdef Q_OS_WINDOWS // This variable comes from dbus-env.bat qputenv("DBUS_SESSION_BUS_ADDRESS", "autolaunch:"); #endif
If you also have all the DBus files, DLLs etc. in the same directory as your .exe, it will work.