Hi Havoc Pennington:<br>
<br>
Thank you for giving implement suggestions.<br>
<br>
I am glad to explain what I am doing.<br>
<br>
It is a "open with" function of applications manager in smart phone.<br>
<br>
when user click a *.mp3 file in file manager, a open with file message <br>
<br>
will be sent to app manager, app manager will find certain media player<br>
<br>
to launch it to open the mp3 file. <br>
<br>
before i implement it by Qt QCopchannel, store the message in /tmp/pid-message RAM file by "data >> QByteArray".<br>
<br>
when media player is started, it will read the /tmp/pid-message file and send out a signal<br>
<br>
in MediaApplication.cpp class.<br>
<br>
Now, I implement it by Gtk and dbus. Also I want to do it by write and read /tmp/pid-message,<br>
<br>
but i don not know how to store into and read from a dbus message pid-message.<br>
<br>
I know some test code can write and read dbus message into a file, but i can not find the source code.<br>
<br>
It is easy to implement by "command lines", something like "MediaPlayer /a/mp3/file.mp3"<br>
<br>
but we want to make it a more general facility , something like <br>
<br>
open_file_with_app_and_save_setting_and_tell_user (const std::string
&file, const std::string &app, bool save, const
std::string &user_message);<br>
<br>
it is a auto message which is sent to app manager by file manager, app
manager will check if the media player is live, if live, then send the
message,<br>
<br>
if not live, should start the media player first, and after the player is ready to receive the message, send message then.<br>
<br><br>
I do not know how Gnome an KDE implement such function.<br>
<br>
<br>
<br><div><span class="gmail_quote">On 1/25/07, <b class="gmail_sendername">Havoc Pennington</b> <<a href="mailto:hp@redhat.com">hp@redhat.com</a>> wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
A queued message with a timeout would create a race condition anyway; it<br>would be more robust if you do it like:<br> 1) start your application B to receive the message<br> 2) in application A, listen for the NameOwnerChanged signal
<br> when B receives its bus name<br> 3) in application A, send your message to B</blockquote><div><br>
This is sound a good idea, I will try it first.<br>
<br>
Thanks:)<br>
<br>
<br>
</div><br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">Havoc<br><br></blockquote></div><br>