Patrick McHale wrote:
> In our IDL file we have tried using
>
> string GetVersion();
>
> The idl file generates:
>
> NS_METHOD GetVersion(char * _retval)
>
The C++ class interface stub should be producing something like
NS_METHOD GetVersion([out, retval] char ** _retval);
You could also experiment with making the function a readonly
attribute from IDL as in ...
attribute readonly string GetVersion;
From JavaScript you would call the method using syntax similar
to the IDL description. From C++ you would use the latter syntax.
// JS
var x = component.GetVersion();
// C++
char *pStr = NULL;
nsResult ret = pObj->GetVersion(*pStr);
// do something with pStr and then ...
nsMemory::Free(pStr);
// its caller's job to release the returned string's memory.
> My question is - can we still use this method and how is
> this implemented. At the present time is to write Java Glue to achieve
> this - but this is not seamless and will require a large amount of glue to
> be implemented. We want to avoid having thousands of tech support calls and
> wish to be able to continue using original HTML code with minimal changes
> necessary to implement XPCOM.
I assume you meant JavaScript and not Java. Using XPCOM you can access
just about any property or method on an XPCOM component.
> Above is an example using the method GetVersion which produces a return
> string. In actuality we have at least 30 other routines that need to be
> setup.
It isn't clear to me whether you are needing to implement your own
XPCOM components. If that is the case, you can write them in C++ or
JavaScript and then manipulate them from your XUL or HTML embedded
JavaScript.
Post here or email me directly if you need help on this.
> With Thanks
>
> Patrick McHale
> Software Engineer
>
> Paul Baxter
> Principal Software Engineer
>
> Powerlan U.S.A.
Regards,
Rick