[Qt-interest] (QtSolutions) SendMessage() of QtSingleApplication retuns

David Ching dc at dcsoft.com
Mon Mar 7 02:15:13 CET 2011


I had the same issue and debugged it as far as this.  I worked around it
simply by calling QtSingleApplication::isRunning() and only if that returns
true do I then call QtSingleApplication::sendMessage().

BTW, I had another issue on Windows that asking the previous instance to
show a window resulted in it's taskbar button flashing, due to Windows
concept of foreground lock timeout.  To workaround that, I first call
AllowSetForegroundWindow() from the current instance.

-- David


-----Original Message-----

Date: Mon, 28 Feb 2011 20:45:09 +0100
From: Marc <cpmarc at gmail.com>

Hello,

We are using QtSolution QtSingleApplication in our application to have only
one instance executing. We have discovered that when there is another
instance runing, in some cases sendMessage (method used to comunicate with
the main instance) function return false, although the main instance has
received the message.

Debugging QtSingleApplication we have observed that
socket.waitForReadyRead(timeout); (line 161) in function sendMessage returns
false sometimes. 




More information about the Qt-interest-old mailing list