Yep -seen that article - I have that article printed out but it isn't
immediately obvious about the reason for the attribute line. The XPIDL
compiler generates the variable name used in the method implementation in the
C++ code, including an 'a' in front of the parameter variable. It shows it
being used and declared but why?.

Is this declaration of this variable in Javascript used as some kind of
reference to data stored in memory - in order to be accessible by Javascript.
I don't understand the link and why it is used.?

i.e
Sample.idl file:

attribute string text  // text from Javascript
attribute string value
void poke(in string aValue);  // if this is defined here in IDL file

There would be a mapping to:

NS_IMETHODIMP SimplePluginInstance::GetText(char * *aText)
NS_IMETHODIMP SimplePluginInstance::SetText(const char * aText)
NS_IMETHODIMP SimplePluginInstance::Poke(const char* aValue)

Regards

Patrick McHale
Powerlan


Sean Echevarria wrote:

> The IDL Author's Guide should address many of your questions:
> http://www.mozilla.org/scriptable/xpidl/idl-authors-guide/rules.html
>
> On Thu, 22 Mar 2001 11:11:54 +1200, Patrick McHale
> <mchalepNO#[EMAIL PROTECTED]> wrote:
>
> >Hi,
> >
> >I am trying to figure out the various bits in an IDL file.
> >
> >The nsISample.idl file has a line 'attribute string value'.  I don't
> >understand
> >what this is for. Also similarly I don't understand the description for:
> >
> >void writeValue(in string aPrefix);
> >void poke(in string aValue);
> >
> >What is the purpose of specifying 'in' - is this supposed to represent
> >Javascript data direction flow between an application. I wish to be able
> >to run an C++ application's methods from Javascript as I cannot do this
> >via Liveconnect as in previous versions of Netscape.  Is there
> >documentation anywhere which actually describes this process of
> >executing C++ applications methods, and the parameter descriptions used
> >in the Javascript code.
> >
> >There is documentation around about XPCOM / XPConnect - but nothing
> >tells me exactly what is needed to be setup from the Javascript end and
> >the requirements to be implemented in the actual C++ code.
> >
> >Patrick McHale
> >Powerlan


Reply via email to