Hi Stephan,
Am Donnerstag, 8. September 2005 09:30 schrieb Stephan Bergmann:
> Arnulf Wiedemann wrote:
> > Hi Stephan,
> >
> > Am Mittwoch, 7. September 2005 14:51 schrieb Stephan Bergmann:
> >>Arnulf Wiedemann wrote:
> >>>Hi,
> >>>using XInvocation2 method getMemberNames I can get all the methods and
> >>>properties of an object. Using XInvocation hasMethod and hasProperty I
> >>>can distinguish between methods and properties.
> >>
> >>I don't know XInvocation in detail, but from looking at the
> >>documentation, XInvocation2.getInfo() seems to be your friend here.
> >
> > sorry, that does not help, there is a lot of information available in
> > InvocationInfo, but nothing which tells me, if that is a service.
>
> XInvocation is about the interface methods (and maybe interface
> attributes---I do not know) and XPropertySet-related properties
> supported by an object; services have nothing to do with that.
>
> >> > In the list of properties there
> >>>
> >>>are sometimes service names.
> >>
> >>Can you give an example of that (what kind of object did you inspect)?
> >>This sounds like an error to me.
> >
> > the object is a com.sun.star.frame.Desktop, created with a
> > createInstanceWithContext. The "funny" property is:
> > DispatchRecorderSupplier
>
> It appears that the given object supports (via its XPropertySet
> interface) a property named "DispatchRecordSupplier".  That there is
> also a service named "com.sun.star.frame.DispatchRecordSupplier" is a
> coincidence.
>
> > It is in the list returned from getMemberNames and hasProperty returns
> > true for that member name, whereas hasMethod returns false (which is
> > correct).
> >
> > If I use the Desktop object and call getPropertyValue with parameter
> > DispatchRecorderSupplier I get the strange object index back.
>
> com.sun.star.beans.XPropertySet.getPropertyValue returns a value of type
> ANY.  I assume that in your case it returns a value of type ANY that
> containts a value of an interface type (probably because the given
> property named "DispatchRecordSupplier" is of an interface type---I do
> not know).  For a value of an interface type, URP uses the combination
> of an empty OID string and a cache index of 0xFFFF to represent the null
> reference.  In other words, getPropertyValue("DispatchRecordSupplier")
> happens to return a null reference in your case.
>
Ah! Now it makes sense if it has to be interpreted as a null reference and you 
are right, the interface returned is XDispatchRecordSupplier.

But why is the name of the property DispatchRecordSupplier if it is the 
XDispatchRecordSupplier interface which is behind it, or is that only the 
choosen name within the implementation?

> (By the way, XInvocation appears to be somewhat flawed, as it throws
> together interface methods and XPropertySet-related properties, which
> can lead to name clashes.)
>
OK.

Thanks,
Arnulf
> -Stephan
>
> > Arnulf
> >
> >>-Stephan
> >>
> >> > How can I find out, that a property is a service
> >>>
> >>>name? I only found out the using getPropertyValue on a service I get an
> >>>empty object id and an object cache index 0xffff directly from the urp
> >>>protocol. Are that the criteria for a service?
> >>>
> >>>Arnulf
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to