Hi,<br><br>I have a function which return a variant. But whenever I am trying to call the function. I receive an error and program terminates. I am unable to understand what is the reason.<br>May be I am not creating the variant in correct way. Could anyone please check the code and error below, and give me an idea what is wrong?
<br><span class="ppt" id="_user_dbus@lists.freedesktop.org"><br><br>DBus::Variant Test::getTestValue()<br>{<br> DBus::Variant var;<br> DBus::MessageIter i = var.writer();<br> MessageIter j = i.new_variant("s");
<br> j.append_string("Test");<br> i.close_container(j);<br><br> return var;<br>}</span><span class="ppt" id="_user_dbus@lists.freedesktop.org"></span><span class="ppt" id="_user_dbus@lists.freedesktop.org">
</span><br><br><br>And the error message is:<br><br>process 6933: arguments to dbus_message_iter_open_container() were incorrect, assertion "(type == DBUS_TYPE_STRUCT && contained_signature == NULL) || (type == DBUS_TYPE_DICT_ENTRY && contained_signature == NULL) || contained_signature != NULL" failed in file
dbus-message.c line 2330.<br>This is normally a bug in some application using the D-Bus library.<br><br>-Thanks & Regards<br>Naveen<br><span class="ppt" id="_user_dbus@lists.freedesktop.org"></span><span class="ppt" id="_user_dbus@lists.freedesktop.org">
</span><span class="ppt" id="_user_dbus@lists.freedesktop.org"></span>