Hello,
Thanks for the responding to our query. This is the original Javascript
that is shipped to our users.
function GetVersion(theSession) {
alert(theSession.GetVersion());
}
We don't want to have to declare a string variable and pass it.
This is the glue code we have added to the original Javascript which we
would NOT like to have to implement for each of our functions.
var str = new Object();
function _GetVersion(theSession) {
theSession.GetVersion(str);
return str;
}
function GetVersion(theSession) {
var str = _GetVersion(theSession);
alert(str.value);
}
Thanks in advance
Patrick McHale
Paul Baxter
"Neil Hodgson" <[EMAIL PROTECTED]> wrote in message
9emmhd$[EMAIL PROTECTED]">news:9emmhd$[EMAIL PROTECTED]...
> I would expect the same char ** parameter as Rick mentioned.
> To allocate and return the string the implementation should be like:
>
> NS_IMETHODIMP X::GetVersion(char **_retval) {
> char *version = "X 1.1";
> *_retval = reinterpret_cast<char*>(
> nsAllocator::Clone(version, strlen(version)+1));
> return (*_retval) ? NS_OK : NS_ERROR_OUT_OF_MEMORY;
> }
>
> Neil
>
>
>