<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=us-ascii">
<TITLE>Message</TITLE>
<META content="MSHTML 6.00.6000.16544" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial color=#0000ff size=2></FONT> </DIV>
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<BLOCKQUOTE dir=ltr
style="PADDING-LEFT: 5px; MARGIN-LEFT: 5px; BORDER-LEFT: #0000ff 2px solid; MARGIN-RIGHT: 0px">
<DIV></DIV><FONT face=Arial color=#0000ff size=2></FONT>
<DIV dir=ltr><BR>I'm Trying to send notification using D-Bus Notify
method.<BR>The thing is, that I do not understand how to properly use
it.<BR>My current code: <A
href="https://github.com/ik5/display-quotes/blob/master/src/units/untquotedbus.pas#L92">https://github.com/ik5/display-quotes/blob/master/src/units/untquotedbus.pas#L92</A><BR><BR>I'ved
marked the place where i Have AccessViolation exception.<BR>What am I doing
wrong here ?<BR><BR><SPAN class=375280018-24112011><FONT face=Arial
color=#0000ff size=2> </FONT></SPAN></DIV></BLOCKQUOTE>
<DIV dir=ltr><SPAN class=375280018-24112011> <FONT face=Arial
color=#0000ff size=2>At first sight there are several things
wrong:</FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial color=#0000ff
size=2>- all values should be pointers to variables. PINTEGER(100) should be
the address of a variable that contains 100.</FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial color=#0000ff
size=2>- null pchars are not allowed (empty strings!)</FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial color=#0000ff
size=2>- DBUS_TYPE_ARRAY should be a group of 4
elements: DBUS_TYPE_ARRAY , the type of array elements (fe
DBUS_TYPE_UINT32), the address of the array, number of elements in the
array</FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial color=#0000ff
size=2>- the array of const should terminate with a
DBUS_TYPE_INVALID</FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial color=#0000ff
size=2>- I doubt DBUS_TYPE_DICT_ENTRY is allowed in
dbus_message_append_args</FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial color=#0000ff
size=2></FONT></SPAN> </DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2>Ludo<SPAN
class=671232419-24112011> </SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011></SPAN></FONT></FONT></FONT></SPAN> </DIV></BLOCKQUOTE>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=671232419-24112011>A small
rectification:</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT><FONT><SPAN
class=671232419-24112011>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2>- DBUS_TYPE_ARRAY should be a group of 4
elements: DBUS_TYPE_ARRAY , the type of array elements (fe
DBUS_TYPE_UINT32), the address of <STRONG>the </STRONG><SPAN
class=671232419-24112011><STRONG>pointer to</STRONG> the </SPAN>array, number of
elements in the array<SPAN
class=671232419-24112011>.</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=671232419-24112011>So to send an uint32,
a string and an array of uint32 you hvae to do the
following:</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=671232419-24112011>var
</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=671232419-24112011>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=671232419-24112011>
i:dword;</SPAN></FONT></FONT></FONT></SPAN></DIV>
s:string;</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=671232419-24112011> aa: array[0..4]
of dword;</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=671232419-24112011>
sp,aap:pointer;</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011>...</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=671232419-24112011>s:='Display
Qoutes';</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011>sp:=@s[1];</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011>aap:=@aa[0];</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011>dbus_message_append_args(msg,</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=671232419-24112011>
DBUS_TYPE_UINT32,</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=671232419-24112011>
[@i,</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011> DBUS_TYPE_STRING,</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011> @sp,</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011> DBUS_TYPE_ARRAY,</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011> DBUS_TYPE_UINT32,</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011> @aap,</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011> PLongInt(5),</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011> DBUS_TYPE_INVALID]
);</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN class=671232419-24112011>Tested on ubuntu
x64, message checked with dbus-monitor.<FONT><FONT><FONT
face=Arial><FONT color=#0000ff><FONT
size=2></FONT></FONT></FONT></FONT></FONT> </FONT></FONT></FONT></FONT></FONT></SPAN></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><SPAN
class=671232419-24112011><FONT><FONT><FONT face=Arial><FONT color=#0000ff><FONT
size=2></FONT></FONT></FONT></FONT></FONT></SPAN></SPAN> </DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><SPAN
class=671232419-24112011><FONT><FONT><FONT face=Arial><FONT color=#0000ff><FONT
size=2>Ludo</SPAN></FONT></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011></SPAN></FONT></FONT></FONT></SPAN> </DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011></SPAN></FONT></FONT></FONT></SPAN> </DIV></SPAN></FONT></FONT></SPAN></DIV>
<DIV dir=ltr><SPAN class=375280018-24112011><FONT face=Arial><FONT
color=#0000ff><FONT size=2><SPAN
class=671232419-24112011> </SPAN></FONT></FONT></FONT></SPAN></DIV></BODY></HTML>