So structures, arrays, etc are out if scriptability is required (but OK if it
isnt?).

I've previously worked on a large C/C++ project which used RPC (using the
Microsoft tools and IDL compiler) for client-server function calls and I was
wondering about doing something similar using XPCOM/XPIDL/XPConnect
(notwithstanding the need to add cross-computer/process support to the latter).
The RPC-called interfaces in the former dont have any special simplification over
those called internally by direct linkage, since the Microsoft MIDL compiler can
process (and output proxy stubs) just about anything that the C/C++ complers can
handle, so there's a lot of nested structures, arrays, etc, getting passed in
parameters.

Sounds like it would be a major peice of work to get the XP.. stuff working in a
similar way, or is that only an issue if scriptability is required ?

Cheers,
Chris.

Rick Parrish wrote:

> Topics Man wrote:
>
> > I should have stated that I'm particularly thinking of the XPCOM IDL
> > compiler (XPIDL) - maybe this has some inherent limitations on the argument
> > types it can handle which aren't limitations of actual XPCOM itself.
> >
> > Cheers
> > Chris
>
> The xpidl compiler is very flexible. However, xpconnect does have some
> difficulty in dealing with (1) multiple out parameters and (2) native
> types (like a structure or void pointer) that can't easily be converted
> to a jsval. If you want your component to be scriptable, avoid items
> (1) and (2) above in your IDL and you should be okay.
>
> Item (1) above can be dealt with and made to work from the JS side
> but requires creating a dummy object and passing that in to receive
> the extra out params - the result is awkward and looks ugly (but works).
>
> Regards,
> Rick


Reply via email to