Kenichi Komiya wrote:
> 
> Hi,
> 
> How I can distinguish nsCID from nsCIDPtr with xptinfo?
> 
> In C++, the difference is clear like below.  But, I could not tell one
> from another, when I deal with these methods with xptinfo.
> 
>    // nsCID foo();       in IDL
>    NS_IMETHOD Foo(nsCID *_retval);
> 
>    // nsCIDPtr foo2();   in IDL
>    NS_IMETHOD Foo2(nsCID * *_retval);
> 
> I tried nsXPTType::IsPointer(), expecting only the later returns
> true.  But, nsCID parameter also returned true.  It seems to me
> that they looked identical to nsIIDPtr type in terms of
> XPTTypeDescriptorPrefix.
> 
> I looked into xpconnect and Python XPCOM, but could not figure
> out how they treat nsCID type.
> 
> What I am trying to do is adding support for nsCID type to the
> Ruby language binding, so that I can implement nsIClassInfo with
> Ruby.  Currently, I can not implement following attribute, because
> nsCID* is mistaken as nsCID**.
> 
>    readonly attribute nsCID classID;

nsCID (as opposed to nsCIDPtr or nsCIDRef) is a new aberration
and was not originally intended to be supported in xpidl (as I
see things). The non-ptr version is certainly not supported for
'in' params because that entails passing a
larger-than-pointer-sized structure by value. And xptcall will
not support that (and it is bad form anyway). Some non-ptr usage
has snuck into the tree and, unfortunately, the current xpidl
compiler is not properly setting the ptr flag in the typelib for
this construct. There are fixes that will land soon to deal with
these cases.

Please see the discussion and patches in...

http://bugzilla.mozilla.org/show_bug.cgi?id=93792

John.

> 
> Best Regards,
> Kenichi Komiya.

Reply via email to